Advertisement
Guest User

seudesign phplockit file => decoded

a guest
Feb 20th, 2013
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 40.09 KB | None | 0 0
  1. <?php
  2. /*
  3.  * @ Pirate-Sky Crew :: PHP Decoder v2
  4.  * @ Author: pLa$71k
  5.  * @ Web: http://pirate-sky.com
  6.  * @ Pirate-Sky Crew © 2008 - 2013
  7.  */
  8.  
  9. include("includes/header.php");
  10. include("classes/pagination_helper.php");
  11. $extendedAccessToken = $facebook->getExtendedAccessToken();
  12. $facebook->setAccessToken($extendedAccessToken);
  13. $accounts = $facebook->api('/me/accounts', 'GET', array(
  14.     'access_token' => $facebook->getAccessToken()
  15. ));
  16. $userData = $facebook->api('/me');
  17. if (isset($_GET['showtime'])) {
  18.     echo date('d-m-Y H-i-s') . '<br />';
  19. }
  20. $accountsInfo = array();
  21. if ($accounts && isset($accounts['data']) && count($accounts['data']) > 0) {
  22.     $accountsInfo                  = parseAccounts($accounts['data']);
  23.     $accountsInfo[$userData['id']] = $userData['name'];
  24. }
  25. if ($userData) {
  26.     $userDbData = user::userExist($userData['id']);
  27.     if (!$userDbData)
  28.         user::createUser($userData, $facebook->getAccessToken());
  29.     else {
  30.         $option['access_token'] = $facebook->getAccessToken();
  31.         user::updateUser($option, $userDbData[0]['id'], $userDbData[0]['uid']);
  32.     }
  33. }
  34. if (isset($_POST['post_profile']) && is_array($_POST['post_profile'])) {
  35.     $_POST['post']['datetime'] = str_replace('Now!', '', $_POST['post']['datetime']);
  36.     $last_time                 = user::getAutoScheduleTime($userId);
  37.     $flag                      = 0;
  38.     $choice                    = array();
  39.     $temp_choice               = $_POST['post_profile'];
  40.     $temp_choice['time']       = $_POST['post']['datetime'];
  41.     $choice['last_choice']     = serialize($temp_choice);
  42.     $choice['access_token']    = $facebook->getAccessToken();
  43.     $last_choice               = $_POST['post_profile'];
  44.     $last_choice['time']       = $_POST['post']['datetime'];
  45.     user::updateUser($choice, $userDbData[0]['id'], $userDbData[0]['uid']);
  46.     foreach ($_POST['post_profile'] as $prf => $value) {
  47.         $schedule = array();
  48.         if ($prf == $userId) {
  49.             $schedule['uid']          = $userId;
  50.             $schedule['access_token'] = $facebook->getAccessToken();
  51.             $schedule['post_to']      = 'user';
  52.         } else {
  53.             $page_access_token = '';
  54.             if ($accounts && isset($accounts['data']) && count($accounts['data']) > 0) {
  55.                 foreach ($accounts['data'] as $page) {
  56.                     if ($page['id'] == $prf) {
  57.                         $page_access_token = $page['access_token'];
  58.                         break;
  59.                     }
  60.                 }
  61.             }
  62.             $schedule['page_id']      = $prf;
  63.             $schedule['access_token'] = $facebook->getAccessToken();
  64.             $schedule['post_to']      = 'page';
  65.         }
  66.         $schedule['status_message'] = $_POST['post']['message'];
  67.         $schedule['status_type']    = $_POST['post']['type'];
  68.         $schedule['created_by']     = $userId;
  69.         if (isset($_POST['post']['repeat_check'])) {
  70.             $schedule['repeat_interval'] = $_POST['post']['repeat_interval'];
  71.             $schedule['repeat_type']     = $_POST['post']['repeat_type'];
  72.             $schedule['repeat_till']     = strtotime($_POST['post']['repeat_till']);
  73.         }
  74.         if (trim($_POST['post']['datetime'])) {
  75.             $newtime                   = adjustCleintServerTime($_POST['post']['datetime'], $_POST['post']['clientTime']);
  76.             $schedule['display_time']  = strtotime($_POST['post']['datetime']);
  77.             $schedule['process_time']  = $newtime;
  78.             $schedule['schedule_type'] = 'schedule';
  79.             if (isset($_POST['post']['auto_delete'])) {
  80.                 $schedule['should_delete']         = 1;
  81.                 $schedule['delete_scheduled_time'] = $schedule['process_time'] + $_POST['post']['auto_del_time'] * 60;
  82.             }
  83.         } elseif ($_POST['auto_schedule'] == '1') {
  84.             if ($last_time) {
  85.                 $new_autoschedule_time = date('Y-m-d H:i:' . '00', ($last_time[0]['display_time'] + 30 * 60));
  86.             } else {
  87.                 $new_autoschedule_time = date('Y-m-d H:i:' . '00', (strtotime($_POST['post']['clientTime']) + 30 * 60));
  88.             }
  89.             $newtime                   = adjustCleintServerTime($new_autoschedule_time, $_POST['post']['clientTime']);
  90.             $schedule['display_time']  = strtotime($new_autoschedule_time);
  91.             $schedule['process_time']  = $newtime;
  92.             $schedule['schedule_type'] = 'schedule';
  93.             if (isset($_POST['post']['auto_delete'])) {
  94.                 $schedule['should_delete']         = 1;
  95.                 $schedule['delete_scheduled_time'] = $schedule['process_time'] + $_POST['post']['auto_del_time'] * 60;
  96.             }
  97.         } else {
  98.             $schedule['schedule_type'] = 'simple';
  99.             $schedule['display_time']  = $_POST['post']['clientTime'];
  100.             if (isset($_POST['post']['auto_delete'])) {
  101.                 $schedule['should_delete']         = 1;
  102.                 $schedule['delete_scheduled_time'] = time() + $_POST['post']['auto_del_time'] * 60;
  103.             }
  104.         }
  105.         switch ($schedule['status_type']) {
  106.             case 'link':
  107.                 if (trim($_POST['post']['linkimage']))
  108.                     $schedule['photo_url'] = $_POST['post']['linkimage'];
  109.                 else if (isset($_FILES['post_picture']) && $_FILES['post_picture']['name'] != '') {
  110.                     $img_name              = uploadImage('post_picture');
  111.                     $schedule['photo_url'] = $global['upload_link'] . $img_name;
  112.                 }
  113.                 $schedule['link']               = $_POST['post']['link'];
  114.                 $schedule['status_name']        = $_POST['post']['name'];
  115.                 $schedule['status_description'] = $_POST['post']['description'];
  116.                 break;
  117.             case 'photo':
  118.                 if ($flag == 0) {
  119.                     $img_name = uploadImage('post_picture');
  120.                     $flag++;
  121.                 }
  122.                 $schedule['photo_url'] = $global['uploadPath'] . $img_name;
  123.                 break;
  124.         }
  125.         if (!$glabal['enabled_auto_delete'])
  126.             $schedule['is_delete'] = -1;
  127.         $db->insert('postcron_schedule', $schedule);
  128.         if (!trim($_POST['post']['datetime']) && $_POST['auto_schedule'] != '1')
  129.             user::sendAutoPost($db->insertid(), $schedule['status_type']);
  130.     }
  131. } elseif (isset($userDbData[0]['last_choice']) && $userDbData[0]['last_choice']) {
  132.     $last_choice = unserialize($userDbData[0]['last_choice']);
  133. }
  134. echo '
  135. <div id="LoggedInUserHomeContent">
  136.  
  137.  <div id="newPostComponent">
  138.  
  139.    <div class="postComposer">
  140.  
  141.      <form method="post" name="postcronform" action="" enctype="multipart/form-data" id="post_form">
  142.  
  143.        <input type="hidden" value="all" id="type-tags" name="type-tags">
  144.  
  145.        <input type="hidden" id="post_id" name="post[id]"><input type="hidden" id="post_caption" name="post[caption]">
  146.  
  147.        <input type="hidden" id="post_linkimage" name="post[linkimage]">
  148.  
  149.        <div class="postTypeChooser" style="background-position: 78px 18px;">
  150.  
  151.          <div class="postTypeText"><span source="SHARE">Share</span>:</div>
  152.  
  153.          <div class="postTypeButtons">
  154.  
  155.            <a source="STATUS" id="status" class="postTypeButton">Status</a>
  156.  
  157.            <a source="LINK" id="link" class="postTypeButton">Link</a>
  158.  
  159.            <a source="PHOTO" id="photo" class="postTypeButton">Photo</a>
  160.  
  161.            <select id="post_type" name="post[type]">
  162.  
  163.              <option value="status">status</option>
  164.  
  165.              <option value="link">link</option>
  166.  
  167.              <option value="photo">photo</option>
  168.  
  169.              <option value="twitt">twitt</option>
  170.  
  171.            </select>
  172.  
  173.          </div>
  174.  
  175.        </div>
  176.  
  177.        <div class="mutableTypeComposer">
  178.  
  179.          <div id="div_post_message" style="display: block;">
  180.  
  181.            <textarea id="post_message" placeholder="What\'s on your mind?" source="WHAT\'S ON YOUR MIND?" class="expand" name="post[message]" cols="30" rows="4" style="height: 17px; overflow: hidden; padding-top: 0px; padding-bottom: 0px;"></textarea>
  182.  
  183.          </div>
  184.  
  185.          <div id="div_post_link" style="display: none;">
  186.  
  187.            <div class="linkComposeDiv">
  188.  
  189.              <input type="text" id="post_link" name="post[link]">
  190.  
  191.            </div>
  192.  
  193.            <div source="ATTACH" class="linkSubmit">Attach</div>
  194.  
  195.          </div>
  196.  
  197.          <div id="div_post_datetime">
  198.  
  199.            <a style="background-position: 0pt 0pt;" title="Cancel" class="deletePostButton closeDatetime" id="closeDatetime"> </a> Schedule<br>
  200.  
  201.            <input type="text" id="post_datetime" name="post[datetime]" >
  202.  
  203.          </div>
  204.  
  205.          <div id="div_post_linkedition" style="display: none;">
  206.  
  207.            <div id="linkPicture"><img id="linkImage" src=""></div>
  208.  
  209.            <div class="linkContent">
  210.  
  211.              <div id="div_post_name" style="display: none;"><textarea name="post[name]" id="post_name"></textarea></div>
  212.  
  213.              <div id="div_post_caption" style="display: none;">
  214.  
  215.                <input type="hidden" id="post_caption" name="post[caption]">
  216.  
  217.              </div>
  218.  
  219.              <div id="div_post_description" style="display: none;">
  220.  
  221.                <textarea class="expand" name="post[description]" id="post_description" style="height: 14px; overflow: hidden; padding-top: 0px; padding-bottom: 0px;"></textarea>
  222.  
  223.              </div>
  224.  
  225.              <div id="div_post_imagechooser" style="display: none;">
  226.  
  227.                <div id="linkImageSwitcherDiv">
  228.  
  229.                  <a id="prevImg" class="linkImageSwitcher"><img src="images/arrowleftw.gif"></a>
  230.  
  231.                  <a id="nextImg" class="linkImageSwitcher"><img src="images/arrowrightw.gif"></a>
  232.  
  233.                  <span class="grayText imageCount" id="labelImageChooser"></span><br>
  234.  
  235.                </div>
  236.  
  237.                <div>
  238.  
  239.                  <input type="checkbox" id="no_picture" name="no_picture">
  240.  
  241.                  <span source="NO THUMBNAIL" class="grayText">No thumbnail</span>
  242.  
  243.                </div>
  244.  
  245.                <div id="linkImageCustomDiv">
  246.  
  247.                  <input type="checkbox" id="custom_picture" name="custom_picture">
  248.  
  249.                  <span source="UPLOAD YOUR OWN PHOTO" class="grayText">Upload thumbnail</span>
  250.  
  251.                </div>
  252.  
  253.              </div>
  254.  
  255.            </div>
  256.  
  257.          </div>
  258.  
  259.          <div id="div_post_picture" style="display: none;">
  260.  
  261.            Photo:
  262.  
  263.            <input type="file" id="post_picture" name="post_picture">
  264.  
  265.          </div>
  266.  
  267.          <input type="hidden" id="post_id" name="post[id]">
  268.  
  269.          <input type="hidden" value="110503" id="fb_page_profile_id">
  270.  
  271.          <input type="hidden" name="post[clientTime]" id="clientTime" value="">
  272.  
  273.          <input type="hidden" id="auto_schedule" name="auto_schedule" >
  274.  
  275.        </div>
  276.  
  277.        <div class="footerButtons">
  278.  
  279.          <a source="TAG THIS PHOTO" id="btn-add-tag" href="javascript:void(0);">Tag this photo</a>
  280.  
  281.          ';
  282. if ($accounts && isset($accounts['data']) && count($accounts['data']) > 0) {
  283.     echo '
  284.                        <!--<select id="post_page_id" name="post_profile[]" multiple="multiple">-->
  285.  
  286.                            ';
  287.     echo "<input type='checkbox' id='selectall' name='selectall'> <b>Select All</b></br>";
  288.     foreach ($accounts['data'] as $page) {
  289.         if ($page['category'] == 'Application')
  290.             continue;
  291.         echo "<input type='checkbox' class='case chkbox' id='" . $page['id'] . "' name='post_profile[" . $page['id'] . "]' ";
  292.         if (isset($last_choice) && is_array($last_choice) && array_key_exists($page['id'], $last_choice))
  293.             echo "checked='checked'";
  294.         echo " > " . $page['name'] . "</br>";
  295.     }
  296.     echo "<input type='checkbox' class='case chkbox' id='" . $userId . "' name='post_profile[" . $userId . "]'> " . $userData['name'] . "</br>";
  297.     echo '
  298.                        <!--</select>-->
  299.  
  300.          ';
  301. }
  302. echo '                <br>
  303.                <div>
  304.                <input type="checkbox" id="repeat_check" name="post[repeat_check]"> Repeat this post every <input style="height: 12px;width: 50px;" type="text" id="repeat_interval" name="post[repeat_interval]" > <select id="repeat_type" name="post[repeat_type]" ><option value="1">Days</option><option value="2">Weeks</option><option value="3">Months</option></select> until <input style="height: 12px;width: 150px;" type="text" id="repeat_till" name="post[repeat_till]" value="';
  305. echo date('Y-m-d', time() + 30 * 24 * 60 * 60);
  306. echo '" ></br>
  307.                
  308.                <input type="checkbox" id="auto_delete" name="post[auto_delete]"> Auto delete this post after <input style="height: 12px;width: 50px;" type="text" id="auto_del_time" name="post[auto_del_time]" value="30" > minutes</br>
  309.            </div>
  310.            <br>
  311.          <input type="submit" name="share" value="Post" source="SHARE" class="facebookButton" id="submit">
  312.  
  313.          <!--<input type="submit" name="schedule" value="Auto Schedule" source="AUTO SCHEDULE" class="facebookButton" id="autoschedule">-->
  314.  
  315.          <input type="button" name="schedule" value="Schedule" source="SCHEDULE" class="facebookButton" id="agendar">
  316.        </div>
  317.  
  318.        <div id="photo-tagger-container">
  319.  
  320.          <div id="photo-tagger">
  321.  
  322.            <div class="photo-tagger-label">Escribe un nombre o etiqueta:</div>
  323.  
  324.            <div class="photo-tagger-input"><input type="text" autocomplete="off" id="input-tag"></div>
  325.  
  326.          </div>
  327.  
  328.          <div id="photo-tagger-options"></div>
  329.  
  330.        </div>
  331.  
  332.        <div style="display: none;" id="content-tags">
  333.  
  334.          Personas etiquetadas en esta foto: <span id="tags"></span>
  335.  
  336.          <div id="hidden-tags"></div>
  337.  
  338.        </div>
  339.  
  340.      </form>
  341.  
  342.    </div>
  343.  
  344.  </div>  
  345.  
  346.  ';
  347. $page        = (isset($_REQUEST['page']) ? $_REQUEST['page'] : 1);
  348. $limit       = 5;
  349. $offset      = ($page - 1) * $limit;
  350. $total       = user::getPostCronScheduleCount();
  351. $scheduleRes = user::getPostCronSchedule($offset, $limit);
  352. if ($scheduleRes) {
  353.     echo '
  354.    <div class="posts">
  355.  
  356.        <form onsubmit="return submitFormlist();" method="post" action="nada/nada" enctype="multipart/form-data" id="postlist_form">
  357.  
  358.          <div id="div_postlist_datetime" style="display: none;">
  359.  
  360.            <a style="background-position: 0pt 0pt;" title="Cancel" class="deletePostButton closeDatetime" id="closeDatetimelist"> </a>
  361.  
  362.          When do you share?<br>
  363.  
  364.            <input type="text" readonly="" name="postlist[datetime]" id="postlist_datetime">
  365.  
  366.        </div>
  367.  
  368.      </form>
  369.  
  370.        ';
  371.     foreach ($scheduleRes as $sch) {
  372.         $actor_id = (trim($sch['uid']) ? $sch['uid'] : $sch['page_id']);
  373.         echo '
  374.        <div id="post_';
  375.         echo $sch['id'];
  376.         echo '" class="post">
  377.  
  378.          <div class="postProfile">
  379.  
  380.              <img width="50" height="50" alt="';
  381.         if (isset($accountsInfo[$actor_id]))
  382.             echo $accountsInfo[$actor_id];
  383.         echo '" src="';
  384.         echo 'https://graph.facebook.com/' . $actor_id . '/picture?type=normal';
  385.         echo '" onclick="window.open(\'https://www.facebook.com/profile.php?id=';
  386.         echo $actor_id;
  387.         echo '\'); return false;" class="ImageLink">
  388.  
  389.          </div>
  390.  
  391.          <div class="postContent">
  392.  
  393.            <div class="postContentMessage">
  394.  
  395.              <div class="topContent">
  396.  
  397.                <div class="profileLink">
  398.  
  399.                  <a class="actor-name" target="_blank" href="https://www.facebook.com/profile.php?id=';
  400.         echo $actor_id;
  401.         echo '">';
  402.         if (isset($accountsInfo[$actor_id]))
  403.             echo $accountsInfo[$actor_id];
  404.         echo '</a>
  405.  
  406.                </div>
  407.  
  408.                <div id="postActions_';
  409.         echo $sch['id'];
  410.         echo '" class="action" style="display: none;">
  411.  
  412.                  <div class="deleteDiv">
  413.  
  414.                    <a onclick="deletePost(';
  415.         echo $sch['id'];
  416.         echo ', \'';
  417.         echo $userId;
  418.         echo '\')" class="deletePostButton" title="delete"> </a>
  419.  
  420.                  </div>
  421.  
  422.                </div>
  423.  
  424.              </div>
  425.  
  426.              <div id="message_';
  427.         echo $sch['id'];
  428.         echo '" class="message editArea editable" title="Click to edit..." style="background-color: white; cursor: pointer;">';
  429.         echo $sch['status_message'];
  430.         echo '</div>
  431.  
  432.            </div>
  433.  
  434.            ';
  435.         if ($sch['status_type'] == 'link') {
  436.             echo '
  437.              <div class="postContentLink">
  438.  
  439.                  ';
  440.             if (trim($sch['photo_url'])) {
  441.                 echo '
  442.                    <div class="linkPicture">
  443.  
  444.                      <img src="';
  445.                 echo $sch['photo_url'];
  446.                 echo '" onclick="window.open(\'';
  447.                 echo $sch['link'];
  448.                 echo '\'); return false;" class="ImageLink PostImageLink">
  449.  
  450.                    </div>
  451.  
  452.                ';
  453.             }
  454.             echo '
  455.                <div class="linkContent">
  456.  
  457.                  <div id="name_';
  458.             echo $sch['id'];
  459.             echo '" class="name edit editable" title="Click to edit" style="background-color: white; cursor: pointer;">';
  460.             echo $sch['status_name'];
  461.             echo '</div>
  462.  
  463.                  <div id="caption_';
  464.             echo $sch['id'];
  465.             echo '" class="caption edit editable" title="Click to edit" style="background-color: white; cursor: pointer;">';
  466.             echo $sch['status_caption'];
  467.             echo '</div>
  468.  
  469.                  <div id="description_';
  470.             echo $sch['id'];
  471.             echo '" class="description edit editable" title="Click to edit" style="background-color: white; cursor: pointer;">';
  472.             echo $sch['status_description'];
  473.             echo '</div>
  474.  
  475.                </div>
  476.  
  477.                  </div>
  478.  
  479.                        ';
  480.         } else if ($sch['status_type'] == 'photo') {
  481.             $tokens = explode('/', $sch['photo_url']);
  482.             $url    = $global['upload_link'] . $tokens[count($tokens) - 1];
  483.             echo '
  484.                <div class="PostPicture">
  485.  
  486.                  <img src="';
  487.             echo $url;
  488.             echo '" onclick="window.open(\'';
  489.             echo $url;
  490.             echo '\'); return false;" class="ImageLink PostImage">
  491.  
  492.              </div>
  493.  
  494.            ';
  495.         }
  496.         echo '
  497.          </div>
  498.  
  499.          <div class="postFooter">
  500.  
  501.            <div class="date">
  502.  
  503.              <input type="hidden" value="';
  504.         echo simpleDate($sch['display_time']);
  505.         echo '" id="datetimeUnformated_';
  506.         echo $sch['id'];
  507.         echo '">              
  508.  
  509.              <span class="editable datetimelistEditable" id="datetime_';
  510.         echo $sch['id'];
  511.         echo '" style="background-color: white; cursor: pointer;">
  512.  
  513.                  ';
  514.         echo formatDate($sch['display_time']);
  515.         echo '
  516.              </span>
  517.  
  518.              <a target="_blank" href="https://www.facebook.com/apps/application.php?id=';
  519.         echo $global['app_id'];
  520.         echo '" class="GrayLink">';
  521.         echo $global['app_name'];
  522.         echo '</a>
  523.  
  524.              ';
  525.         if (isset($accountsInfo[$actor_id]))
  526.             echo $accountsInfo[$actor_id];
  527.         echo '
  528.            </div>
  529.  
  530.            ';
  531.         echo '
  532.          </div>
  533.  
  534.        </div>
  535.  
  536.      ';
  537.     }
  538.     echo getPagination($page, $total, $limit, 'index.php?i=1');
  539.     echo '
  540.      </div>
  541.  
  542.    ';
  543. } else {
  544.     echo '
  545.    ';
  546. }
  547. echo '
  548. </div>
  549.  
  550.  
  551.  
  552. <a href="" id="check-perms"></a>
  553.  
  554.  
  555.  
  556. ';
  557. include("includes/footer.php");
  558. echo '
  559. <script type="text/javascript" src="';
  560. echo $global['home_link'];
  561. echo 'js/editable.js?v=3"></script>
  562.  
  563. <script type="text/javascript" src="';
  564. echo $global['home_link'];
  565. echo 'js/list.js?v=3"></script>
  566.  
  567. <script>
  568.  
  569.    var userID = \'';
  570. echo $userId;
  571. echo '\';
  572.  
  573.    var tab = \'\';
  574.  
  575.    
  576.  
  577.    function getCurrentTime()
  578.  
  579.    {
  580.  
  581.        var d = new Date();
  582.  
  583.        var month = (d.getMonth()+1);
  584.  
  585.        var numberDay = d.getDate();
  586.  
  587.        var formatTime = d.getFullYear()+\'-\'+(month < 10 ? \'0\'+month : month)+\'-\'+(numberDay < 10 ? \'0\'+numberDay : numberDay)+\' \'+d.getHours()+\':\'+d.getMinutes()+\':00\';
  588.  
  589.        return formatTime;
  590.  
  591.    }
  592.  
  593.    
  594.  
  595.    $(document).ready(function ()
  596.  
  597.    {
  598.  
  599.        getCurrentTime();
  600.  
  601.        //ensure_init("donoting");
  602.  
  603.        
  604.  
  605.        //date picket show
  606.  
  607.        $("#agendar").click(function(){
  608.  
  609.            InitDatetimePicker();
  610.  
  611.            //$("#auto_schedule").val("1");
  612.  
  613.           $("#div_post_datetime").show(300);
  614.  
  615.        });
  616.        
  617.        $("#ui-datepicker-close").show();
  618.        
  619.        
  620.        $(\'#repeat_till\').datepicker({minDate:0, dateFormat: \'yy-mm-dd\', showButtonPanel: false});
  621.        
  622.        $("#datetime_done").click(function(){
  623.        alert("hnjghjhg");
  624.            $("#ui-datepicker-div").hide();
  625.        });
  626.      
  627.  
  628.        
  629.  
  630.        $("#autoschedule").click(function(){
  631.  
  632.            //InitDatetimePicker();
  633.  
  634.            $("#auto_schedule").val("1");
  635.  
  636.           //$("#div_post_datetime").show(300);
  637.  
  638.           if($(\'#photo-tagger-container\').is(\':visible\'))
  639.  
  640.                return false;
  641.  
  642.            else
  643.  
  644.                return submitForm();
  645.  
  646.        });
  647.  
  648.            
  649.  
  650.            /* Top Menus toggle*/
  651.  
  652.            $(\'#status\').click(function(){
  653.  
  654.            tab = \'status\';
  655.  
  656.          $(\'#btn-add-tag\').hide();
  657.  
  658.        });
  659.  
  660.            
  661.  
  662.        $(\'#link\').click(function(){
  663.  
  664.            tab = \'link\';
  665.  
  666.            $(\'#btn-add-tag\').hide();
  667.  
  668.        });
  669.  
  670.            
  671.  
  672.        $(\'#photo\').click(function(){
  673.  
  674.            tab = \'photo\';
  675.  
  676.            $(\'#btn-add-tag\').hide();
  677.  
  678.        });
  679.  
  680.            
  681.  
  682.            /* parse and get url data*/
  683.  
  684.            $(\'.linkSubmit\').click(function() {
  685.  
  686.            getUrlContent($(\'#post_link\').val());
  687.  
  688.        });
  689.  
  690.            
  691.  
  692.                $(\'#post_form\').submit(function(){
  693.  
  694.                if($(\'#photo-tagger-container\').is(\':visible\'))
  695.  
  696.                    return false;
  697.  
  698.                else
  699.  
  700.                    return submitForm();
  701.  
  702.        });
  703.  
  704.        // add multiple select / deselect functionality
  705.  
  706.    В В В В $("#selectall").click(function () {
  707.  
  708.    В В В В В В В В В В $(\'.case\').attr(\'checked\', this.checked);
  709.  
  710.    В В В В });
  711.  
  712.    В
  713.  
  714.    В В В В // if all checkbox are selected, check the selectall checkbox
  715.  
  716.    В В В В // and viceversa
  717.  
  718.    В В В В $(".case").click(function(){
  719.  
  720.    В
  721.  
  722.    В В В В В В В В if($(".case").length == $(".case:checked").length) {
  723.  
  724.    В В В В В В В В В В В В $("#selectall").attr("checked", "checked");
  725.  
  726.    В В В В В В В В } else {
  727.  
  728.    В В В В В В В В В В В В $("#selectall").removeAttr("checked");
  729.  
  730.    В В В В В В В В }
  731.  
  732.    В
  733.  
  734.    В В В В });
  735.  
  736.    });
  737.  
  738.    
  739.  
  740.    //Cada vez que cambie el tipo de publicacion, limpio los campos no usados y los oculto
  741.  
  742.    $(\'#post_type\').change(function() {
  743.  
  744.            typeSelectorChange($("#post_type").val());
  745.  
  746.    });
  747.  
  748.    //<<Reload>> Cada vez que cambie el tipo de publicacion, limpio los campos no usados y los oculto
  749.  
  750.    $(\'.postTypeButton\').click(function() {
  751.  
  752.            $("#post_type").val(this.id);
  753.  
  754.            typeSelectorChange(this.id);
  755.  
  756.    });
  757.  
  758.    
  759.  
  760.    function typeSelectorChange(newValue)
  761.  
  762.    {
  763.  
  764.    switch (newValue)
  765.  
  766.        {
  767.  
  768.            case "status":
  769.  
  770.                $(".postTypeChooser").css(\'background-position\',\'78px 18px\');
  771.  
  772.                superHide (["message","description","caption","link","linkedition","name","picture","imagechooser"]);
  773.  
  774.                $("#post_message").blur();
  775.  
  776.                $(\'#div_post_message\').show();
  777.  
  778.                $(\'#post_message\').show();
  779.  
  780.                break;
  781.  
  782.  
  783.  
  784.            case "link":
  785.  
  786.                $(".postTypeChooser").css(\'background-position\',\'155px 18px\');
  787.  
  788.                superHide (["message","description","caption","link","linkedition","name","picture","imagechooser"]);
  789.  
  790.                $("#post_message").blur();
  791.  
  792.                $("#post_link").blur();
  793.  
  794.                $(\'#div_post_link\').show();
  795.  
  796.                $(\'#post_link\').show();
  797.  
  798.                break;
  799.  
  800.        
  801.  
  802.            case "photo":
  803.  
  804.                $(".postTypeChooser").css(\'background-position\',\'230px 18px\');
  805.  
  806.                superHide (["message","description","caption","link","linkedition","name","picture","imagechooser"]);
  807.  
  808.                $("#post_message").blur();
  809.  
  810.                superShow(["picture","message"]);
  811.  
  812.                break;
  813.  
  814.        
  815.  
  816.            case "twitt":
  817.  
  818.                $(".postTypeChooser").css(\'background-position\',\'303px 18px\');
  819.  
  820.                superHide (["message","description","caption","link","linkedition","name","picture","imagechooser"]);
  821.  
  822.                $("#post_message").blur();
  823.  
  824.                $(\'#div_post_message\').show();
  825.  
  826.                $(\'#post_message\').show();
  827.  
  828.                break;
  829.  
  830.    }
  831.  
  832.    }
  833.  
  834.    
  835.  
  836.    function superHide(arrayToHide)
  837.  
  838.    {
  839.  
  840.    for (c=0; c < arrayToHide.length; c++)
  841.  
  842.        {
  843.  
  844.        $(\'#div_post_\'+arrayToHide[c]).hide();
  845.  
  846.      if(arrayToHide[c]=="picture")
  847.  
  848.          $(\'.imagePostEditing\').hide();
  849.  
  850.    }
  851.  
  852.    }
  853.  
  854.    
  855.  
  856.    function superShow(arrayToShow)
  857.  
  858.    {
  859.  
  860.    for (c=0; c < arrayToShow.length; c++)
  861.  
  862.        {
  863.  
  864.        $(\'#div_post_\'+arrayToShow[c]).show();
  865.  
  866.      if(arrayToShow[c]=="picture")
  867.  
  868.          $(\'.imagePostEditing\').show();
  869.  
  870.    }
  871.  
  872.    }
  873.  
  874.  
  875.  
  876.    var stringI18N = new Array ();
  877.  
  878.    stringI18N["promptTimes"] = "How many times do you want to multiply the post? (21 or less)";
  879.  
  880.    stringI18N["promptDays"] = "How often many days?";
  881.  
  882.    stringI18N["promptRefresh"] = "Do you want to refresh to see changes?";
  883.  
  884.    stringI18N["promptDelete"] = "Are you sure you want to delete the post?";
  885.  
  886.    stringI18N["messageCanceled"] = "Canceled";
  887.  
  888.    
  889.  
  890.    stringI18N["messageWOYMind"]="What\'s on your mind?";
  891.  
  892.    
  893.  
  894.    stringI18N["messageMiss"]="The following errors were found";
  895.  
  896.    stringI18N["messageRightNow"]="";
  897.  
  898.    stringI18N["messageSavePost"]="Save";
  899.  
  900.    stringI18N["messageSaveWait"]="Please Wait";
  901.  
  902.    stringI18N["messageSaveClickToEdit"]="Edit";
  903.  
  904.    
  905.  
  906.    stringI18N["messageSubmitErrorPage"]="Missing Fan Page";
  907.  
  908.    stringI18N["messageSubmitErrorMessage"]="Message is required";
  909.  
  910.    stringI18N["messageSubmitErrorLink"]="Link is required";
  911.  
  912.    stringI18N["messageSubmitErrorImageFormat"]="The selected image is not valid type (jpg, png or gif)";
  913.  
  914.    stringI18N["messageSubmitErrorImageMissing"]="Choose an image to upload";
  915.  
  916.    
  917.  
  918.    stringI18N["messageWriteSomething"]= "Write something first";
  919.  
  920.    stringI18N["setHour"]= "Set hour";
  921.    
  922.    stringI18N["exceededMax"] = "Exceeded maxium selection limit of ';
  923. echo $global['max_sel'];
  924. echo '";
  925.  
  926.    //stringI18N["messageThanks1"]= "Thanks for your help";
  927.  
  928.  
  929.  
  930.    function InitDatetimePicker()
  931.  
  932.    {
  933.  
  934.      var date;
  935.    ';
  936. if (isset($last_choice['time'])) {
  937.     echo '    date = new Date(\'';
  938.     echo date("M d, Y H:i:s", strtotime($last_choice['time']));
  939.     echo '\');
  940.    ';
  941. } else {
  942.     echo '    date = new Date();
  943.    ';
  944. }
  945. echo '
  946.    $("#post_datetime").val("messageRightNow");    
  947.    //Los cambios se guardan en #timepicker_alt
  948.  
  949.    $("#div_post_datetime").append(\'<div id="post_datetime_inline"></div><input type="hidden" id="timepicker_alt"/>\')
  950.  
  951.    $(\'#post_datetime_inline\').datetimepicker({
  952.  
  953.        altField: \'#timepicker_alt\',
  954.  
  955.        dateFormat: \'yy-mm-dd\',
  956.        defaultDate: date,
  957.  
  958.        timeFormat: \'hh:mm\',
  959.  
  960.        minDate: 0,
  961.  
  962.        hour: date.getHours(),
  963.  
  964.        minute: date.getMinutes(),
  965.        //minute: 24
  966.  
  967.    })
  968.  
  969.    //este hack es por q #post_datetime_inline aveces tiene una hora y otra veces tiene un date solo
  970.  
  971.    //entonces segun que tenga lo tomo o no, y lo junto con la hora resultante del timepicker_alt, un quilombo
  972.  
  973.    .change(function() {
  974.  
  975.        nuevoValor = $("#post_datetime_inline").val();
  976.  
  977.        if(nuevoValor.search(":") == -1){//alert(nuevoValor + " " + $(\'#timepicker_alt\').val()+ ":00");
  978.  
  979.            $("#post_datetime").val(nuevoValor + " " + $(\'#timepicker_alt\').val()+ ":00");
  980.  
  981.            if(new Date() >= parseSymfonyDatetime($("#post_datetime").val())) {//alert("kkkk");
  982.  
  983.                //$("#post_datetime").val(stringI18N["messageRightNow"]);
  984.  
  985.            }
  986.  
  987.            }
  988.  
  989.    });
  990.  
  991.  
  992.  
  993.    // Boton cerrar calendario
  994.  
  995.    $("#closeDatetime").click(function(){
  996.  
  997.        $("#div_post_datetime").hide(300);
  998.  
  999.        $(\'#post_datetime_inline\').datetimepicker(\'setDate\', (desiredDate) );
  1000.  
  1001.    });
  1002.  
  1003.  
  1004.  
  1005.    $("#post_datetime").attr("readonly","readonly");
  1006.  
  1007.    if ($("#post_datetime").val()) {
  1008.  
  1009.        //desiredDate = parseSymfonyDatetime($("#post_datetime").val());
  1010.        //alert(desiredDate);
  1011.        ';
  1012. if (isset($last_choice['time'])) {
  1013.     echo '        desiredDate = new Date(\'';
  1014.     echo date("M d, Y H:i:s", strtotime($last_choice['time']));
  1015.     echo '\');
  1016.        ';
  1017. } else {
  1018.     echo '        desiredDate = new Date();
  1019.        ';
  1020. }
  1021. echo '    } else {
  1022.        ';
  1023. if (isset($last_choice['time'])) {
  1024.     echo '        desiredDate = new Date(\'';
  1025.     echo date("M d, Y H:i:s", strtotime($last_choice['time']));
  1026.     echo '\');
  1027.        ';
  1028. } else {
  1029.     echo '        desiredDate = new Date();
  1030.        ';
  1031. }
  1032. echo '        
  1033.  
  1034.    }
  1035.    $(\'#post_datetime_inline\').datetimepicker(\'setDate\', (desiredDate) );
  1036.  
  1037.    }
  1038.  
  1039.    
  1040.  
  1041.    function parseSymfonyDatetime(v)
  1042.  
  1043.    {
  1044.  
  1045.    return new Date(v[0]+v[1]+v[2]+v[3],((v[5]+v[6])-1), v[8]+v[9], v[11]+v[12],  v[14]+v[15], 0, 0);
  1046.  
  1047.    }
  1048.  
  1049.    
  1050.  
  1051.    function submitForm()
  1052.  
  1053.    {
  1054.  
  1055.    pass = false;
  1056.  
  1057.    post_type = $("#post_type").val();
  1058.  
  1059.    error_msg = "";
  1060.  
  1061. /*
  1062.  
  1063.    if($("#post_page_id").val() == "" || $("#post_page_id").val() == null)
  1064.  
  1065.        {
  1066.  
  1067.        error_msg = error_msg + "* "+ stringI18N["messageSubmitErrorPage"] + "\\n";
  1068.  
  1069.    }
  1070.  
  1071. */    
  1072.  
  1073.    var checkFound = false;
  1074.    
  1075.    var n = $("input:checkbox.chkbox:checked").length;
  1076.    
  1077.    ';
  1078. if ($global['max_sel'] > 0) {
  1079.     echo '    
  1080.    if(n > ';
  1081.     echo $global['max_sel'];
  1082.     echo '){
  1083.        error_msg = error_msg + "* "+ stringI18N["exceededMax"] + "\\n";
  1084.    }
  1085.    
  1086.    ';
  1087. }
  1088. echo '
  1089.    for (var counter=0; counter < post_form.length; counter++) {
  1090.  
  1091.       if ((post_form.elements[counter].type == "checkbox") && (post_form.elements[counter].checked == true)) {
  1092.  
  1093.          checkFound = true;
  1094.  
  1095.          }
  1096.  
  1097.       }
  1098.  
  1099.    if (checkFound != true) {
  1100.  
  1101.       error_msg = error_msg + "* "+ stringI18N["messageSubmitErrorPage"] + "\\n";
  1102.  
  1103.       }
  1104.      
  1105.    
  1106.  
  1107.  
  1108.  
  1109.       switch(post_type)
  1110.  
  1111.        {
  1112.  
  1113.        case "status":
  1114.  
  1115.          if($("#post_message").val().length == 0)
  1116.  
  1117.                {
  1118.  
  1119.                    error_msg = error_msg + "* "+ stringI18N["messageSubmitErrorMessage"] + "\\n";
  1120.  
  1121.        }
  1122.  
  1123.        break;
  1124.  
  1125.            
  1126.  
  1127.            case "link":
  1128.  
  1129.                if($("#post_caption").val().length == 0)
  1130.  
  1131.                {
  1132.  
  1133.                    error_msg = error_msg + "* "+ stringI18N["messageSubmitErrorLink"] + "\\n";
  1134.  
  1135.                }
  1136.  
  1137.                if($("#no_picture").is(":checked"))
  1138.  
  1139.                {
  1140.  
  1141.                    $("#post_linkimage").val("");
  1142.  
  1143.                    $("#post_picture").val("");
  1144.  
  1145.                }
  1146.  
  1147.                else
  1148.  
  1149.                {
  1150.  
  1151.                    if($("#custom_picture").is(":checked"))
  1152.  
  1153.                    {
  1154.  
  1155.                        $("#post_linkimage").val("");
  1156.  
  1157.                        file = $("#post_picture").val();
  1158.  
  1159.                        if(file.length > 0)
  1160.  
  1161.                        {
  1162.  
  1163.                            mime = file.substr(file.lastIndexOf(\'.\'));
  1164.  
  1165.                            if(mime!= \'.gif\' && mime!= \'.jpg\' && mime!= \'.jpeg\' && mime!= \'.png\' && mime!= \'.GIF\' && mime!= \'.JPG\' && mime!= \'.JPEG\' && mime!= \'.PNG\')
  1166.  
  1167.                                error_msg = error_msg + "* "+ stringI18N["messageSubmitErrorImageFormat"] + "\\n";
  1168.  
  1169.                        }
  1170.  
  1171.                    }
  1172.  
  1173.                    else
  1174.  
  1175.                    {
  1176.  
  1177.                        $("#post_picture").val("");
  1178.  
  1179.                    }
  1180.  
  1181.                }
  1182.  
  1183.        break;
  1184.  
  1185.      
  1186.  
  1187.            case "photo":
  1188.  
  1189.                file = $("#post_picture").val();
  1190.  
  1191.                oldImage=$(".imagePostEditing").attr("src");
  1192.  
  1193.                
  1194.  
  1195.                if(file.length == 0)
  1196.  
  1197.                {
  1198.  
  1199.                    if(!oldImage.length > 0)//puede que estГ© editando
  1200.  
  1201.                        error_msg = error_msg + "* "+ stringI18N["messageSubmitErrorImageMissing"] + "\\n";
  1202.  
  1203.                }    
  1204.  
  1205.                else
  1206.  
  1207.                {
  1208.  
  1209.                    mime = file.substr(file.lastIndexOf(\'.\'));
  1210.  
  1211.                    if(mime!= \'.gif\' && mime!= \'.jpg\' && mime!= \'.jpeg\' && mime!= \'.png\' && mime!= \'.GIF\' && mime!= \'.JPG\' && mime!= \'.JPEG\' && mime!= \'.PNG\')
  1212.  
  1213.                        error_msg = error_msg + "* "+ stringI18N["messageSubmitErrorImageFormat"] + "\\n";
  1214.  
  1215.                }
  1216.  
  1217.                break;
  1218.  
  1219.    }
  1220.  
  1221.  
  1222.  
  1223.    /*var pendingPost = verifyPendingPost();
  1224.  
  1225.    if(pendingPost[\'error\'])
  1226.  
  1227.        {
  1228.  
  1229.        jConfirm(pendingPost[\'error\'], \'Error\', function(r){
  1230.  
  1231.                if(r)
  1232.  
  1233.                {
  1234.  
  1235.                    window.location = pendingPost[\'redirect\'];
  1236.  
  1237.                }
  1238.  
  1239.      });
  1240.  
  1241.      return false;
  1242.  
  1243.    }*/
  1244.  
  1245.  
  1246.  
  1247.    if(error_msg == "")
  1248.  
  1249.        {
  1250.  
  1251.        pass= true
  1252.  
  1253.    }
  1254.  
  1255.        else
  1256.  
  1257.        {
  1258.  
  1259.         jAlert("\\n"+ stringI18N["messageMiss"] + ":\\n\\n" + error_msg, \'Error\');
  1260.  
  1261.    }
  1262.  
  1263.        
  1264.  
  1265.        var clientTime = getCurrentTime();
  1266.  
  1267.        $(\'#clientTime\').val(clientTime);
  1268.  
  1269.        
  1270.  
  1271.    return pass;
  1272.  
  1273.    }
  1274.  
  1275.    
  1276.  
  1277.    function getUrlContent(url)
  1278.  
  1279.    {
  1280.  
  1281.      url = escape(url);
  1282.  
  1283.    $.ajax({
  1284.  
  1285.            type: "POST",
  1286.  
  1287.            url: callbackURL+\'ajax.php\',
  1288.  
  1289.            data: \'url=\' + url + \'&action=getUrlContent\',
  1290.  
  1291.            dataType: \'json\',
  1292.  
  1293.            success: function(data)
  1294.  
  1295.                        {
  1296.  
  1297.                if(!data[\'error\'])
  1298.  
  1299.                            {
  1300.  
  1301.                   editeLinkOk(data);
  1302.  
  1303.              }
  1304.  
  1305.                            else
  1306.  
  1307.                            {
  1308.  
  1309.                  alert(data[\'message\']);
  1310.  
  1311.              }
  1312.  
  1313.            }
  1314.  
  1315.    });
  1316.  
  1317.    }
  1318.  
  1319.    
  1320.  
  1321.    var imageLinkNum;
  1322.  
  1323.  var imageLinkCurrent;
  1324.  
  1325.  var imageLinkArray;
  1326.  
  1327.    function editeLinkOk(data)
  1328.  
  1329.    {
  1330.  
  1331.        $("#post_caption").val($("#post_link").val());
  1332.  
  1333.        $("#post_link").val(data[\'url\']);
  1334.  
  1335.        $("#post_message").val(\'\');
  1336.  
  1337.    $("#post_name").val(data[\'title\']);
  1338.  
  1339.    $("#post_description").val(data[\'description\']);
  1340.  
  1341.        
  1342.  
  1343.        //ResizeTextarea();
  1344.  
  1345.    $(\'#post_description\').css("height", "auto")
  1346.  
  1347.  
  1348.  
  1349.                
  1350.  
  1351.        $(\'#div_post_link\').hide();
  1352.  
  1353.    $(\'#post_link\').hide();
  1354.  
  1355.    
  1356.  
  1357.        try
  1358.  
  1359.        {
  1360.  
  1361.        delete window.imageLinkArray;
  1362.  
  1363.      delete window.imageLinkNum;
  1364.  
  1365.    }catch(e){window["imageLinkArray"] = undefined;window["imageLinkNum"] = undefined;}
  1366.  
  1367.    
  1368.  
  1369.        imageLinkArray = data["images"];
  1370.  
  1371.    imageLinkNum = data["numImages"];
  1372.  
  1373.    changeImage("starting");
  1374.  
  1375.    superShow(["linkedition","message","imagechooser","caption","name","description"]);
  1376.  
  1377.    $("#post_description").click();
  1378.  
  1379.    }
  1380.  
  1381.    
  1382.  
  1383.    function changeImage(way)
  1384.  
  1385.    {
  1386.  
  1387.        $("#linkImage").attr("src", \'images/loading.gif\');
  1388.  
  1389.        if(way == "starting")
  1390.  
  1391.        {
  1392.  
  1393.        if(imageLinkNum >= 1)
  1394.  
  1395.            {
  1396.  
  1397.          imageLinkCurrent = 1;
  1398.  
  1399.      }
  1400.  
  1401.    }
  1402.  
  1403.        
  1404.  
  1405.        if(way == "nextImg")
  1406.  
  1407.        {
  1408.  
  1409.        if(imageLinkCurrent < imageLinkNum)
  1410.  
  1411.            {
  1412.  
  1413.          imageLinkCurrent++;
  1414.  
  1415.      }
  1416.  
  1417.    }
  1418.  
  1419.        else if(way == "prevImg")
  1420.  
  1421.        {
  1422.  
  1423.        if(imageLinkCurrent > 1)
  1424.  
  1425.            {
  1426.  
  1427.          imageLinkCurrent--;
  1428.  
  1429.      }
  1430.  
  1431.    }
  1432.  
  1433.        
  1434.  
  1435.        if(imageLinkNum >= 1)
  1436.  
  1437.        {
  1438.  
  1439.            var linkImage = escape(imageLinkArray[imageLinkCurrent-1]);
  1440.  
  1441.            
  1442.  
  1443.            $("#post_linkimage").val(imageLinkArray[imageLinkCurrent-1]);
  1444.  
  1445.      $("#linkImage").attr("src", unescape(linkImage));
  1446.  
  1447.      $("#labelImageChooser").html("" + imageLinkCurrent + " of " + imageLinkNum);
  1448.  
  1449.      $(\'#custom_picture\').attr(\'checked\', false);
  1450.  
  1451.    }
  1452.  
  1453.        else
  1454.  
  1455.        {//cuando no se trajo ninguna imagen
  1456.  
  1457.        $(\'#custom_picture\').attr(\'checked\', true);//
  1458.  
  1459.      superShow(["picture","message"]);
  1460.  
  1461.      $("#linkImageSwitcherDiv a").hide();//
  1462.  
  1463.      $("#post_linkimage").val("");//
  1464.  
  1465.      $("#linkImage").attr("src", "");//
  1466.  
  1467.      $("#labelImageChooser").html("No image for this site");//
  1468.  
  1469.    }
  1470.  
  1471.    }
  1472.  
  1473.    
  1474.  
  1475.    $(\'#prevImg\').mousedown(function() {
  1476.  
  1477.      $("#prevImg img").attr("src","images/arrowleft.gif");
  1478.  
  1479.  });
  1480.  
  1481.  
  1482.  
  1483.    $(\'#prevImg\').mouseup(function() {
  1484.  
  1485.      $("#prevImg img").attr("src","images/arrowleftw.gif");
  1486.  
  1487.  });
  1488.  
  1489.  
  1490.  
  1491.    $(\'#nextImg\').mousedown(function() {
  1492.  
  1493.      $("#nextImg img").attr("src","images/arrowright.gif");
  1494.  
  1495.  });
  1496.  
  1497.  
  1498.  
  1499.    $(\'#nextImg\').mouseup(function() {
  1500.  
  1501.      $("#nextImg img").attr("src","images/arrowrightw.gif");
  1502.  
  1503.  });
  1504.  
  1505.    
  1506.  
  1507.    $(".linkImageSwitcher").click(function(){
  1508.  
  1509.      changeImage(this.id);
  1510.  
  1511.  });
  1512.  
  1513.    
  1514.  
  1515.    $("#post_description").hover(function () {
  1516.  
  1517.      $(this).css(\'background-color\',\'#ffff99\');
  1518.  
  1519.    $(this).css(\'cursor\',\'pointer\');
  1520.  
  1521.  },
  1522.  
  1523.  function () {
  1524.  
  1525.      $(this).css(\'background-color\',\'white\');
  1526.  
  1527.  });
  1528.  
  1529.  
  1530.  
  1531.    $(".facebookButton").hover(function () {
  1532.  
  1533.      $(this).css(\'background-color\',\'#4F6AA3\');
  1534.  
  1535.    },
  1536.  
  1537.  function () {
  1538.  
  1539.      $(this).css(\'background-color\',\'#617AAC\');
  1540.  
  1541.  });
  1542.  
  1543.  
  1544.  
  1545.    $("#post_caption").hover(function () {
  1546.  
  1547.        $(this).css(\'background-color\',\'#ffff99\');
  1548.  
  1549.        $(this).css(\'cursor\',\'pointer\');
  1550.  
  1551.    },
  1552.  
  1553.    function () {
  1554.  
  1555.        $(this).css(\'background-color\',\'white\');
  1556.  
  1557.    });
  1558.  
  1559.  
  1560.  
  1561.    $("#post_name").hover(function () {
  1562.  
  1563.        $(this).css(\'background-color\',\'#ffff99\');
  1564.  
  1565.        $(this).css(\'cursor\',\'pointer\');
  1566.  
  1567.    },
  1568.  
  1569.    function () {
  1570.  
  1571.        $(this).css(\'background-color\',\'white\');
  1572.  
  1573.    });
  1574.  
  1575.    
  1576.  
  1577.    $("#no_picture").click(function(){
  1578.  
  1579.        if($(this).is(":checked")){
  1580.  
  1581.            $("#linkImageSwitcherDiv").hide();
  1582.  
  1583.            $("#linkPicture").hide();
  1584.  
  1585.            $("#div_post_picture").hide();
  1586.  
  1587.            $("#linkImageCustomDiv").hide();
  1588.  
  1589.        }
  1590.  
  1591.        else{
  1592.  
  1593.            $("#linkImageSwitcherDiv").show();
  1594.  
  1595.            $("#linkPicture").show();
  1596.  
  1597.            $("#linkImageCustomDiv").show();
  1598.  
  1599.        }
  1600.  
  1601.    });
  1602.  
  1603.    
  1604.  
  1605.    $("#custom_picture").click(function(){
  1606.  
  1607.        if($(this).is(":checked"))
  1608.  
  1609.            {
  1610.  
  1611.          $("#linkImageSwitcherDiv").hide();
  1612.  
  1613.        $("#linkPicture").hide();
  1614.  
  1615.        superShow(["picture","message"]);
  1616.  
  1617.      }
  1618.  
  1619.      else
  1620.  
  1621.            {
  1622.  
  1623.          $("#div_post_picture").hide();
  1624.  
  1625.        $("#linkImageSwitcherDiv").show();
  1626.  
  1627.        $("#linkPicture").show();
  1628.  
  1629.      }
  1630.  
  1631.       });
  1632.  
  1633.        
  1634.  
  1635.        function verifyPendingPost()
  1636.  
  1637.        {
  1638.  
  1639.        var pendingPost = \'\';    
  1640.  
  1641.            $.ajax({
  1642.  
  1643.                    type: "POST",
  1644.  
  1645.                    url: \'/ajax_verify_pending_posts\',
  1646.  
  1647.                    dataType: \'json\',
  1648.  
  1649.                    async: false,
  1650.  
  1651.                    success: function(data) {
  1652.  
  1653.                            pendingPost = data;
  1654.  
  1655.                    }
  1656.  
  1657.            });
  1658.  
  1659.        
  1660.  
  1661.            return pendingPost;
  1662.  
  1663.        }
  1664.  
  1665.    //$(\'#custom_picture\').attr(\'checked\', false);
  1666.  
  1667.    //$(\'#no_picture\').attr(\'checked\', false);
  1668.  
  1669. </script>';
  1670. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement