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

PermaLink to this entry https://pastebin.co.uk/12202
Posted by admin_users Sun 25th Mar 2007 05:00 - Syntax is PHP - 80 viewsRun this post in the PHP shell
Download | New Post | Modify | Hide line numbers

 

Comments: 0