Posted by kkkk Sun 25th Mar 2007 04:13 - Syntax is PHP - 63 viewsRun this post in the PHP shell
Download | New Post | Modify | Hide line numbers
PHP parser reported no syntax errors in this post!
  1. if ($_GET["mode"] == "viewlinks"){ // view users' links
  2.             global $offset, $page_size;
  3.             $offset=(get_current_page()-1)*$page_size;
  4.            
  5.             $usersql = mysql_query("SELECT * FROM " . table_users . " where user_login='".$_GET['user']."'");
  6.             $userdata = array();
  7.           while ($row = mysql_fetch_array ($usersql, MYSQL_ASSOC)) array_push ($userdata, $row);
  8.             $main_smarty->assign('userdata', $userdata);
  9.  
  10.             $usersql = mysql_query("SELECT * FROM " . table_links . " where link_author='".$userdata[0][user_id]."' ORDER BY link_date DESC LIMIT $offset,$page_size");
  11.             $links = array();
  12.           while ($row = mysql_fetch_array ($usersql, MYSQL_ASSOC)) array_push ($links, $row);
  13.             $main_smarty->assign('links', $links);                   
  14.            
  15.             $rows = $db->get_var("SELECT count(*) FROM " . table_links . " where link_author='".$userdata[0][user_id]."'");
  16.            
  17.             if(isset($_POST["process"])) {       
  18.                 if ($_REQUEST['status'] == "discard") {           
  19.                     $db->query('UPDATE `' . table_links . '` SET `link_status` = "discard" WHERE `link_id` = "'.$_GET["id"].'"');
  20.                   //header("Location: ".my_pligg_base."/admin_users.php?mode=viewlinks&user=".$userdata[user_login]."");               
  21.                 }
  22.                 elseif ($_REQUEST['status'] == "published") {           
  23.                     $db->query('UPDATE `' . table_links . '` SET `link_status` = "published" WHERE `link_id` = "'.$_GET["id"].'"');
  24.                   //header("Location: ".my_pligg_base."/admin_users.php?mode=viewlinks&user=".$userdata[user_login]."");               
  25.                 }
  26.                 elseif ($_REQUEST['status'] == "queued") {           
  27.                     $db->query('UPDATE `' . table_links . '` SET `link_status` = "queued" WHERE `link_id` = "'.$_GET["id"].'"');
  28.                   //header("Location: ".my_pligg_base."/admin_users.php?mode=viewlinks&user=".$userdata[user_login]."");               
  29.                 }
  30.             }
  31.  
  32.             // breadcrumbs and page title
  33.             $navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
  34.             $navwhere['link1'] = getmyurl('admin', '');
  35.             $navwhere['text2'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel_1');
  36.             $navwhere['link2'] = my_pligg_base . "/admin_users.php";
  37.             $navwhere['text3'] = $main_smarty->get_config_vars('PLIGG_Visual_View_User_Sub_Links');
  38.             $main_smarty->assign('navbar_where', $navwhere);
  39.             $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
  40.      
  41.                         // pagename
  42.             define('pagename', 'admin_users');
  43.                       $main_smarty->assign('pagename', pagename);
  44.      
  45.              // show the template
  46.             $main_smarty->assign('tpl_center', $the_template . '/admin_templates/user_view_links_center');
  47.             $main_smarty->display($the_template . '/pligg.tpl');
  48.         }

PermaLink to this entry https://pastebin.co.uk/12199
Posted by kkkk Sun 25th Mar 2007 04:13 - Syntax is PHP - 63 viewsRun this post in the PHP shell
Download | New Post | Modify | Hide line numbers

 

Comments: 0