function draw_category($category) { $args = queryString(queryConstruct(array('view' => 'category', 'category' => $category['path']), array('categoryview'), array('referendum_search_'))); echo "<dt><a href='{$_SERVER["SCRIPT_NAME"]}?{$args}'>{$category['title']} ({$category['type']})</a></dt>\n"; echo "<dd>\n"; echo "{$category['text']}"; draw_category_list($category['children']); echo "</dd>\n"; }
function drawSelectView($view, $title) { $url = $_SERVER["SCRIPT_NAME"] . "?" . queryString(queryConstruct(array('view' => $view))); $cls = 'menu_non_current'; if ($_GET["view"] == $view) { $cls = 'menu_current'; } return "<a class='menu {$cls}' href='{$url}'>{$title}</a>"; }
function drawSelectCategoryView($view, $title, $reset = array(), $resetpattern = array()) { $url = $_SERVER["SCRIPT_NAME"] . "?" . queryString(queryConstruct(array('categoryview' => $view), $reset, $resetpattern)); $cls = 'viewmenu_non_current'; if ($_GET["categoryview"] == $view) { $cls = 'viewmenu_current'; } return "<a class='viewmenu {$cls}' href='{$url}'>{$title}</a>"; }
function bread_array($breads, $seperate = " > ") { $bread = array(); uasort($breads, "bread_compare"); foreach ($breads as $key => $val) { if (!empty($val['url'])) { if (isset($val['params'])) { $bread[] = "<a href='" . $val['url'] . queryString($val['params']) . "' target='_self' title='" . $val['title'] . "'>" . $val['title'] . "</a>"; } else { $bread[] = "<a href='" . $val['url'] . "' target='_self' title='" . $val['title'] . "'>" . $val['title'] . "</a>"; } } else { $bread[] = $val['title']; } } return implode($seperate, $bread); }
foreach (array_reverse($para['sub']) as $sub) { paraToSql($sub); } foreach (array_reverse($para['next']) as $next) { paraToSql($next); } } foreach (array_reverse($para_root) as $root) { paraToSql($root); } } } } $sql .= "end;"; pg_query($dbconn, $sql) or die('Unable to add referendum: ' . pg_last_error()); $row = pg_fetch_row(pg_query($dbconn, "select currval('referendum_id_seq');")) or die('Unable to fetch id of new referendum: ' . pg_last_error()); $referendum = $row[0]; if (in_array('vote', $_SESSION['privs'])) { $sql = "select cast_vote('{$referendum}', '{$_SESSION['user']}', '1');"; pg_query($dbconn, $sql) or die(T_('Unable to insert vote: ') . pg_last_error()); $messages .= "<div>" . sprintf(T_("Vote registered for referendum %s"), $referendum) . "</div>"; } $referendumurl = $_SERVER["SCRIPT_NAME"] . '?' . queryString(queryConstruct(array('view' => 'category', 'categoryview' => 'referendums', 'referendum_search_status__1_list' => 'on', 'referendum_search_status__0_list' => 'on', 'referendum_search_status__-1_list' => 'on', 'referendum_search_referendum_lower' => $referendum, 'referendum_search_referendum_upper' => $referendum, 'expanded_referendums' => $referendum), array(), array('referendum_search_'))); if (isset($fudinc)) { $fudid = fud_new_topic(sprintf(T_("%s:%s: %s"), $category_path, $referendum, $_POST['new_referendum_title']), sprintf("<h1><a href='%s' target='_blank'>" . T_("%s:%s: %s") . "</a></h1>" . T_("This thread is for discussions on the above DemoWave administered referendum."), $referendumurl, $category_path, $referendum, $_POST['new_referendum_title']), 3, $fuduser, $fudforum); pg_query($dbconn, "insert into referendum_fud (referendum, fudid) values('{$referendum}', '{$fudid}')") or die('Unable to add referendum FUDfudforum topic: ' . pg_last_error()); } header("Status: 303 See Other"); header("Location: " . $referendumurl); exit(1); }
| Copyright (c) 2007-2010 Clip-Bucket.com. All rights reserved. | @ Author : ArslanHassan | @ Software : ClipBucket , © PHPBucket.com * ************************************************************* */ define("THIS_PAGE", 'manage_videos'); define("PARENT_PAGE", "videos"); require 'includes/config.inc.php'; $userquery->logincheck(); $udetails = $userquery->get_user_details(userid()); assign('user', $udetails); assign('p', $userquery->get_user_profile($udetails['userid'])); $mode = $_GET['mode']; $page = mysql_clean($_GET['page']); $get_limit = create_query_limit($page, VLISTPP); assign('queryString', queryString(NULL, array('type', 'makeProfileItem', 'removeProfileItem', 'vid_delete'))); switch ($mode) { case 'uploaded': default: assign('mode', 'uploaded'); //Deleting Video if (!empty($_GET['vid_delete'])) { $video = mysql_clean($_GET['vid_delete']); $cbvideo->delete_video($video); } //Deleting Videos if (isset($_POST['delete_videos'])) { for ($id = 0; $id <= VLISTPP; $id++) { $cbvideo->delete_video($_POST['check_vid'][$id]); } $eh->flush();
/** * Function used to display video manager link| */ function video_manager_ep_link($vid) { if (is_video_in_editors_pick($vid['videoid'])) { return '<li><a role="menuitem" tabindex="-1" href="' . queryString(NULL, array('remove_editor_pick', 'add_editor_pick', 'mode')) . 'remove_editor_pick=' . $vid['videoid'] . '">Remove From Editor\'s Pick</a><li>'; } else { return '<li><a role="menuitem" tabindex="-1" href="' . queryString(NULL, array('remove_editor_pick', 'add_editor_pick', 'mode')) . 'add_editor_pick=' . $vid['videoid'] . '">Add To Editor\'s Pick</a></li>'; } }
<?php /* *********************************************************************** | Copyright (c) 2007-2010 Clip-Bucket.com. All rights reserved. | @ Author : ArslanHassan | @ Software : ClipBucket , © PHPBucket.com ************************************************************************* */ require '../includes/admin_config.php'; $userquery->admin_login_check(); $pages->page_redir(); if ($_GET['kick']) { if ($sess->kick(mysql_clean($_GET['kick']))) { e("User has been kicked out", "m"); } } $results = 30; $page = mysql_clean($_GET['page']); $get_limit = create_query_limit($page, $results); $online_users = $userquery->get_online_users(false, false, $get_limit); $total_rows = $userquery->get_online_users(false, true); $total_pages = count_pages($total_rows, $results); $pages->paginate($total_pages, $page); assign('total', count($online_users)); assign('online_users', $online_users); assign('queryString', queryString(NULL, 'kick')); subtitle("View online users"); template_files('online_users.html'); display_it();
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ?> <span class="categorypath"> <?php if ($_GET["category"] == '') { $items = array(); } else { $items = explode('.', $_GET["category"]); } $res = array(); $subpath = array(); $args = queryString(queryConstruct(array('category' => ''), array('categoryview'), array('referendum_search_'))); $res = array("<span><a href='{$_SERVER["SCRIPT_NAME"]}?{$args}'>" . T_("Top") . "</a></span>\n"); foreach ($items as $item) { $subpath[] = $item; $args = queryString(queryConstruct(array('category' => implode('.', $subpath)), array('categoryview'), array('referendum_search_'))); $res[] = "<span><a href='{$_SERVER["SCRIPT_NAME"]}?{$args}'>{$item}</a></span>\n"; } echo implode(' >> ', $res); ?> </span>
} if (get('query') != '') { $cond = " (photos.photo_title LIKE '%" . mysql_clean(get('query')) . "%' OR photos.photo_tags LIKE '%" . mysql_clean(get('query')) . "%' )"; } $photo_arr = array('user' => userid(), "limit" => $get_limit, "cond" => $cond); $photos = $cbphoto->action->get_favorites($photo_arr); assign('photos', $photos); $photo_arr['count_only'] = true; $total_rows = $cbphoto->action->get_favorites($photo_arr); $total_pages = count_pages($total_rows, MAINPLIST); //Pagination $pages->paginate($total_pages, $page); subtitle(lang("manage_favorite_photos")); break; case "my_album": assign('albumPrivacyUrl', queryString('', 'album_privacy')); assign('mode', 'orphan'); if (isset($_GET['album_privacy'])) { if (in_array(get('album_privacy'), array('private', 'public', 'friends'))) { $db->update(tbl("users"), array("album_privacy"), array(mysql_clean(get("album_privacy"))), " userid='" . userid() . "'"); e(lang("album_privacy_updated"), 'm'); $udetails['album_privacy'] = get('album_privacy'); assign('user', $udetails); } } if (isset($_GET['delete_orphan_photo'])) { $id = mysql_clean($_GET['delete_orphan_photo']); $cbphoto->delete_photo($id); } if (isset($_POST['delete_orphan_photos'])) { $total = count($_POST['check_photo']);
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ if ($is_category) { ?> <?php if (array_get($_GET, 'search_referendums_show', '')) { $status = "heading_expanded"; $args = queryString(queryConstruct(array(), array('search_referendums_show'))); } else { $status = "heading_collapsed"; $args = queryString(queryConstruct(array('search_referendums_show' => '1'), array())); } $title = T_("Search for referendums"); echo "<h2 class='{$status}'><a href='{$_SERVER["SCRIPT_NAME"]}?{$args}'>{$title}</a></h2>"; if (array_get($_GET, 'search_referendums_show', '')) { ?> <form action="<?php echo $_SERVER["SCRIPT_NAME"]; ?> " method="get" enctype="multipart/url-encoded"> <?php foreach ($_GET as $key => $value) { if (!beginsWith($key, 'referendum_search_')) { echo "<input name='{$key}' value='{$value}' type='hidden'>\n"; } }
} else { $box = 'out'; } $total = count($_POST['msg_id']); for ($pms = 0; $pms < $total; $pms++) { if (!empty($_POST['msg_id'][$pms])) { $cbpm->delete_msg($_POST['msg_id'][$pms], userid(), $box); } $eh->flush(); e(lang('private_messags_deleted'), 'm'); } } switch ($mode) { case 'inbox': default: $query_string = queryString(NULL, array('thread_id')); assign('query_string', $query_string); $threads = $cbpm->get_threads(array('userid' => userid())); assign('threads', $threads); //ADd new message if (isset($_POST['add_message'])) { $tid = mysql_clean($_POST['thread_id']); $cbpm->send_message(array('thread_id' => $tid, 'subject' => post('subject'), 'message' => post('message'))); } //Get Messages if thread is selected if (isset($_GET['thread_id'])) { $tid = mysql_clean($_GET['thread_id']); $messages = $cbpm->get_messages(array('thread_id' => $tid)); //Get Thread details.. $thread = $cbpm->get_thread($tid); assign('thread', $thread);
function isHasChild($parentid) { $isHasChild = false; if (isDbConnect()) { $conn = pg_connect(getConnectionString()); $queryString = ""; // XIBAR-OLD $queryString = "select count(1) as xcount "; $queryString .= queryString(); $queryString .= "and a.parentid = " . $parentid . " "; $recordset = pg_query($conn, $queryString); while ($row = pg_fetch_object($recordset)) { $isHasChild = $row->xcount > 0 ? true : false; } pg_close(getConnectionString()); } return $isHasChild; }
</select><br /> <input name="payrefs" type="hidden" id="payrefs" /> <input name="process" type="submit" id="process" value="Process" style="width: 125px;" disabled="disabled" /><input name="delete" type="button" id="delete" value="Delete" style="width: 75px;" onclick="rlRemPayment()" disabled="disabled" /><br /> <br /> To delete a row, select it<br /> and press <em>Delete</em>. </form> </fieldset> </td> </tr> </table> <?php } else { ?> <form name="paymentform" id="paymentform" action="<?php echo $_SERVER['PHP_SELF'] . queryString(); ?> " method="post"> <table border="0" align="center" cellpadding="2" cellspacing="2" id="paymentheader"> <tr> <?php if ($payShow == 1) { ?> <td width="550" align="center">Below is a list of the reference numbers you selected for payment. Please confirm that all payments are for the full amount. If the payment is not for the full amount, adjust the <em>Amount to Pay</em> column accordingly. You will be warned if you try to enter an amount greater than the amount outstanding.</td> <?php } else { ?>
} if (isset($node['path'])) { printf("<input\n\t class='law_edit_insert'\n\t name='law_edit_insert_%s'\n\t type='submit'\n\t value='Insert new paragraph after %s' />\n\t ", $node['path'], $node['path']); echo "</div>\n"; } } ?> <form method="post" enctype="multipart/form-data"> <input type='hidden' name='law_edit_continue' value='yes' /> <table class="law_importexport"> <?php echo drawInputRow(T_("Import from file"), "<input name='law_import_file' type='file'>"); echo drawInputRow('', "<input name='law_import' type='submit' value='" . T_("Import") . "'>"); $lawexporturl = '?' . queryString(queryConstruct(array('categoryview' => 'laweditor', 'format' => 'export', 'law_edit_continue' => 'yes'))); echo drawInputRow(T_("Export to file"), "<a href='{$lawexporturl}' target='demowave-export'>" . T_("Export") . "</a>"); ?> </table> <table> <?php $title = array_get($_SESSION["laweditor"], "title", ""); echo drawInputRow(T_("Change summary"), "<input type='text' name='law_title' value='{$title}' />"); echo drawInputRow('', "<input name='law_save' type='submit' value='" . T_("Save changes") . "'>"); ?> </table> <h3><?php E_("Contents"); ?>
$get_limit = create_query_limit($page, $limit); assign("group", $gdetails); //Getting Group Members (Active Only) $gp_mems = $cbgroup->get_members($gdetails['group_id'], $get_limit); $pending_mems = $cbgroup->get_members($gdetails['group_id'], $get_limit, 'no'); assign('pending_members', $pending_mems); assign('group_members', $gp_mems); assign('group_members_mixed', array('all_members' => $gp_mems, 'pending_members' => $pending_mems)); } else { e(lang("grp_exist_error")); } } break; case 'manage_videos': //assign querystring $queryString = queryString(NULL, array('disapprove', 'approve', 'delete')); assign('queryString', $queryString); assign('mode', 'manage_videos'); $gid = mysql_clean($_GET['gid']); $gdetails = $cbgroup->get_group_details($gid); $gArray = array('group' => $gdetails, 'groupid' => $gid, 'uid' => userid(), 'user' => $userquery->udetails, 'checkowner' => 'yes'); if (!$cbgroup->is_admin($gArray) && !has_access('admin_access', true)) { e(lang("you_cant_moderate_group")); } else { //Activating videos if (isset($_POST['activate_videos'])) { $total = count($_POST['check_vid']); for ($i = 0; $i < $total; $i++) { if ($_POST['check_vid'][$i] != '') { $cbgroup->video_actions($gid, $_POST['check_vid'][$i], 'activate'); }
Copyright (C) 2006 RedHog (Egil Möller) <*****@*****.**> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ?> <h2><?php E_("Sub-categories"); ?> </h2> <ul> <?php foreach ($subcategories as $category) { $args = queryString(queryConstruct(array('category' => $category_path_connect . $category), array('categoryview'), array('referendum_search_'))); echo "<li><a href='{$_SERVER["SCRIPT_NAME"]}?{$args}'>{$category}</a></li>"; } ?> </ul>
/** * Display template changer for users if it is * allowed by administrator * * @author Fawaz Tahir <*****@*****.**> * @global $cbtpl; */ function display_template_changer() { if (ALLOW_STYLE_SELECT) { global $cbtpl; $templates = $cbtpl->get_templates(true); // Arrange templates according to name // A - Z if ($templates) { ksort($templates); $list = ''; $fields = get_template_fields(); $active_template = get_active_template(); foreach ($templates as $template) { // Only get commonly used fields foreach ($fields as $field) { if ($template[$field]) { $tem[$field] = $template[$field]; } } $tem = apply_filters($tem, 'template_selection'); if (!$tem['name'] or !$template['dir']) { continue; } $params_item['file'] = 'blocks/template_changer/item.html'; $params_item['template'] = $tem; $active = $active_template == $template['dir'] ? ' active' : ''; $list .= '<li class="template-item' . $active . '" id="template-' . $template['dir'] . '" data-template="' . $template['dir'] . '">'; $list .= '<a href="' . queryString('set_the_template=' . $template['dir'] . '', array('set_the_template')) . '">'; $list .= fetch_template_file($params_item); $list .= '</a>'; $list .= '</li>'; } } $params['file'] = 'blocks/template_changer/template_changer.html'; $params['templates_list'] = $list; return fetch_template_file($params); } return false; }
<?php } ?> </table> <?php if ($group['Box']) { ?> </fieldset> <?php } ?> </td> </tr> <?php } ?> <tr> <td height="10"></td> </tr> <tr> <td><input name="back" type="button" id="back" value="Back to Registration List" style="width: 175px;" onclick="location.href = 'attendee_rego_list.php<?php echo queryString("view", NULL); ?> '" /></td> </tr> </table> </td> </tr> </table> <?php do_html_footer();
<ul> <li><a href="?before=change&top=in&val1=10&val2=20">changeKey</a></li> <li><a href="?a1=abc&a2=def&min=10&max=20&arr[]=123&arr[]=456">mix</a></li> <li><a href="?name=git">format</a></li> </ul> </div> <hr> <div class="col-sm-12"> <h2>input</h2> <p><?php echo currentUri(); ?> </p> <pre><?php var_dump(queryString()); ?> </pre> <hr> </div> <div class="col-sm-12"> <h2>output</h2> <pre><?php var_dump($res); ?> </pre> </div> </div> </body> </html>
/** * Sorting Links is used to return * Sorting based link */ function sort_link($sort, $mode = 'sort', $type) { switch ($type) { case 'video': case 'videos': case 'v': if (!isset($_GET['cat'])) { $_GET['cat'] = 'all'; } if (!isset($_GET['time'])) { $_GET['time'] = 'all_time'; } if (!isset($_GET['sort'])) { $_GET['sort'] = 'most_recent'; } if (!isset($_GET['page'])) { $_GET['page'] = 1; } if (!isset($_GET['seo_cat_name'])) { $_GET['seo_cat_name'] = 'All'; } if ($mode == 'sort') { $sorting = $sort; } else { $sorting = $_GET['sort']; } if ($mode == 'time') { $time = $sort; } else { $time = $_GET['time']; } if (SEO == 'yes') { return BASEURL . '/videos/' . $_GET['cat'] . '/' . $_GET['seo_cat_name'] . '/' . $sorting . '/' . $time . '/' . $_GET['page']; } else { return BASEURL . '/videos.php?cat=' . $_GET['cat'] . '&sort=' . $sorting . '&time=' . $time . '&page=' . $_GET['page'] . '&seo_cat_name=' . $_GET['seo_cat_name']; } break; case 'channels': case 'channel': if (!isset($_GET['cat'])) { $_GET['cat'] = 'all'; } if (!isset($_GET['time'])) { $_GET['time'] = 'all_time'; } if (!isset($_GET['sort'])) { $_GET['sort'] = 'most_recent'; } if (!isset($_GET['page'])) { $_GET['page'] = 1; } if (!isset($_GET['seo_cat_name'])) { $_GET['seo_cat_name'] = 'All'; } if ($mode == 'sort') { $sorting = $sort; } else { $sorting = $_GET['sort']; } if ($mode == 'time') { $time = $sort; } else { $time = $_GET['time']; } if (SEO == 'yes') { return BASEURL . '/channels/' . $_GET['cat'] . '/' . $_GET['seo_cat_name'] . '/' . $sorting . '/' . $time . '/' . $_GET['page']; } else { return BASEURL . '/channels.php?cat=' . $_GET['cat'] . '&sort=' . $sorting . '&time=' . $time . '&page=' . $_GET['page'] . '&seo_cat_name=' . $_GET['seo_cat_name']; } break; default: if (!isset($_GET['cat'])) { $_GET['cat'] = 'all'; } if (!isset($_GET['time'])) { $_GET['time'] = 'all_time'; } if (!isset($_GET['sort'])) { $_GET['sort'] = 'most_recent'; } if (!isset($_GET['page'])) { $_GET['page'] = 1; } if (!isset($_GET['seo_cat_name'])) { $_GET['seo_cat_name'] = 'All'; } if ($mode == 'sort') { $sorting = $sort; } else { $sorting = $_GET['sort']; } if ($mode == 'time') { $time = $sort; } else { $time = $_GET['time']; } if (THIS_PAGE == 'photos') { $type = 'photos'; } if (defined("IN_MODULE")) { $url = 'cat=' . $_GET['cat'] . '&sort=' . $sorting . '&time=' . $time . '&page=' . $_GET['page'] . '&seo_cat_name=' . $_GET['seo_cat_name']; $plugURL = queryString($url, array("cat", "sort", "time", "page", "seo_cat_name")); return $plugURL; } if (SEO == 'yes') { return BASEURL . '/' . $type . '/' . $_GET['cat'] . '/' . $_GET['seo_cat_name'] . '/' . $sorting . '/' . $time . '/' . $_GET['page']; } else { return BASEURL . '/' . $type . '.php?cat=' . $_GET['cat'] . '&sort=' . $sorting . '&time=' . $time . '&page=' . $_GET['page'] . '&seo_cat_name=' . $_GET['seo_cat_name']; } break; } }
assign('to', $to); while ($i < $total) { if ($photos[$i]['photo_id']) { $cbphoto->generate_photos($photos[$i]['photo_id']); $msg[] = $photos[$i]['photo_id'] . ": Re-created '<strong>" . $photos[$i]['photo_title'] . "</strong>'"; } $i++; } if ($stop_loop != 'yes') { e($start_index + 1 . " - " . $to . " photos image have been recreated.", "m"); } assign("index_msgs", $msg); assign("indexing", "yes"); assign('button', 'mass_recreation'); if (!$stop_loop) { $url = queryString("loop_size={$loop_size}&start_index={$next_index}&mass_recreation=yes", array("loop_size", "start_index", "button")); header("Refresh: 2; url=" . BASEURL . "/admin_area/recreate_thumbs.php{$url}"); } } break; case "collection": assign('mode', $mode); $cid = mysql_clean($_GET['cid']); if ($cbphoto->collection->collection_exists($cid)) { if (isset($_POST['recreating'])) { $total = count($_POST['check_photo']); for ($i = 0; $i < $total; $i++) { $cbphoto->generate_photos($_POST['check_photo'][$i]); } $eh->flush(); e($total . " photo(s) have been re-created. Please remove browser cache if you don't see any change.", "m");
echo date('Y-m-d', $dayEnd); ?> " /> </div> <label for="frmSubmit" style="width:30px"> </label> <input type="submit" value="Search" id="frmSubmit"> </fieldset> </form> <table> <thead> <tr><th>Date</th></tr> </thead> <tbody> <?php foreach ($segmentsByDay as $day) { echo '<tr><td><a href="' . $_SERVER['SCRIPT_NAME'] . queryString('Day', $day['start']) . '">' . date('l j F Y', $day['start']) . '</a>' . '<span class="visualLabel">' . count($day['segments']) . '</span></td></tr>'; } ?> </tbody> </table> </div> <div id="RightPanel"> <?php if (isset($segmentsByDay[$filterDay])) { // Sort recordings in order of most recent. $recordings = $segmentsByDay[$filterDay]['segments']; usort($recordings, function ($a, $b) { return strcmp($b['cust_startTime'], $a['cust_startTime']); });
/** * Function displays the photo manager links. Here we will check if link * is function or simple string. If function, call it and return the result. * Than if callback exists, append it's id at end of returned result. * * filter used: photo_manager_links * * @global OBJECT $cbphoto * @param type $photo * @return string */ function display_manager_links($photo, $front_end = false) { global $cbphoto; $which_end = $front_end === true || FRONT_END ? 'front_end' : 'back_end'; $links = $cbphoto->manager_links[$which_end]; $links = apply_filters($links, 'photo_manager_links'); if ($links) { foreach ($links as $link) { // Creating link. Either function or string if (function_exists($link['link']) && is_string($link['link'])) { $url = $link['link']($photo); } else { $url = $link['link']; } if (!$url) { continue; // Skip this index } if (is_array($url)) { /* Sometimes we need to change title according to conditions. Return array with title and link * indexes in your function to do so. For example return result should be like following: * * function name() { * .......... * ........ * .... * .. * . * return array( 'title' => 'New title', 'link' => 'your_link' ); * } * */ $remove_query_variables = $url['remove_query_variables']; $link['title'] = $url['title'] ? $url['title'] : $link['title']; $url = $url['link'] ? $url['link'] : $link['link']; } if ($_SERVER['QUERY_STRING'] && strpos($url, '.php') === false && strpos($url, '?') !== false) { // QUERY_STRING exists and $url does not have .php // append QUERY_STRING before $url $url = ltrim($url, '?'); // removing the ? from start of string parse_str($url, $variables); // changing $url query string to array if ($variables) { $query_string_variables = array_keys($variables); // extracting only names of variables if ($query_string_variables) { if ($remove_query_variables && is_array($remove_query_variables)) { $query_string_variables = array_merge($query_string_variables, $remove_query_variables); $query_string_variables = array_unique($query_string_variables); } $query_string = queryString(null, $query_string_variables); } $url = $query_string . $url; } } // Appeding callback_id if callback exists if ($link['callback']) { if (strpos($url, '?') !== false) { $url .= '&callback_id=' . $link['callback_id']; } else { $url .= '?callback_id=' . $link['callback_id']; } } if ($link['args'] && is_array($link['args'])) { $attributes = ''; foreach ($link['args'] as $attribute => $value) { $attributes .= $attribute . "='" . $value . "' "; } } $output .= '<li><a id="' . $link['id'] . '" href="' . $url . '" ' . $attributes . '>' . $link['title'] . '</a></li>'; } return $output; } }
/** * Setup for dashboard for my account */ function setup_myaccount_dashboard() { add_dashboard_widget('myaccount', 'account_dashboard_messages', 'Messages', 'account_dashboard_messages'); add_dashboard_widget('myaccount', 'account_dashboard_user_content', 'Your Content', 'account_dashboard_user_content'); add_dashboard_widget('myaccount', 'account_dashboard_recent_video_comments', 'Recent Video Comments', 'account_dashboard_recent_video_comments', 'account_dashboard_recent_video_comments_callback'); /* Handle form submission here */ if (confirm_config_form_submission()) { $place = mysql_clean(post('place')); $id = mysql_clean(post('id')); $importance = mysql_clean(post('importance')); if ($place and $id and $importance) { $dashboard = get_dashboard($place); if ($dashboard[$importance] and $dashboard[$importance][$id]) { $widget = $dashboard[$importance][$id]; __call_widget_options_callback($widget); redirect_to(queryString('', array('configure'))); exit('Redirecting ...'); } } } }
} } } echo " </td>" . "</tr>"; } } if ($category_type == "law") { $proposals = array(); if (isset($_GET["law_proposal"]) && $_GET["law_proposal"]) { $proposals = explode(',', $_GET["law_proposal"]); } foreach ($referendums as $attr) { $proposals[] = $attr['referendum']; } $proposals = implode(",", $proposals); $url = '?' . queryString(queryConstruct(array('categoryview' => 'law', 'law_show__deleted_list' => 'on', 'law_date' => $attr['completed'], 'law_show__referendum_list' => '1', 'law_proposal' => $proposals))); ?> <tr><td></td><td></td><td></td><td></td><td></td><td></td><td><?php printf("<a href='%s'>%s</a>\n", $url, T_("Law view")); ?> </td></tr> <?php } if ($_GET['categoryview'] == 'referendums') { ?> <tr><td></td><td></td><td></td><td></td><td></td><td></td><td><input type="submit" name="save_referendums_vote" value="<?php E_("Cast votes"); ?> "></td></tr> <?php }
function drawPrevNextPage($len, $page_start, $page_len, $page_start_name, $page_len_name) { $first = T_("First"); $prev = T_("Previous"); $next = T_("Next"); $last = T_("Last"); if ($page_start > 0) { $args = queryString(queryConstruct(array($page_start_name => 0))); $first = "<a href='{$_SERVER["SCRIPT_NAME"]}?{$args}'>{$first}</a>"; $newstart = $page_start - $page_len; if ($newstart <= 0) { $newstart = 0; } $args = queryString(queryConstruct(array($page_start_name => $newstart))); $prev = "<a href='{$_SERVER["SCRIPT_NAME"]}?{$args}'>{$prev}</a>"; } if ($page_start + $page_len < $len) { $args = queryString(queryConstruct(array($page_start_name => $page_start + $page_len))); $next = "<a href='{$_SERVER["SCRIPT_NAME"]}?{$args}'>{$next}</a>"; $args = queryString(queryConstruct(array($page_start_name => $len - $page_len))); $last = "<a href='{$_SERVER["SCRIPT_NAME"]}?{$args}'>{$last}</a>"; } return sprintf(T_("<div class='nextprevpage'>" . " <span class='prevpage'>" . " %s %s" . " </span>" . " <span class='nextpage'>" . " %s %s" . " </span>" . "</div>"), $first, $prev, $next, $last); }
add_object_manager_order(lang("A - Z"), " users.first_name ASC, users.username ASC", "manage_subscriptions"); add_object_manager_order(lang("Lastest Subscription"), " subscriptions.date_added DESC", "manage_subscriptions"); add_object_manager_order(lang("Lastest Activity"), " subscriptions.last_activity DESC", "manage_subscriptions"); $userid = userid(); $user = get_user_details($userid); if ($user) { $confirm = get('confirm'); if ($confirm == 1) { $subscribe = get('subscribe'); $unsubscribe = get('unsubscribe'); if ($subscribe || $unsubscribe) { $sub_id = get('owner'); $sub = get_user_details($sub_id); if ($sub) { $body = lang('<div class=\\"name-avatar\\"><img src=\\"' . $userquery->getUserThumb($sub) . '\\" class=\\"avatar\\"/><span class=\\"name\\">%s</div>'); $url = queryString('confirm=2', array('confirm')); $is_subscribed = is_user_subscribed($sub['userid']); $continue = true; if ($subscribe and !$is_subscribed) { $heading = sprintf(lang('Subscribe %s'), name($sub)); $body = sprintf($body, "Please confirm, you want to subscribe " . name($sub)); } else { if ($unsubscribe and $is_subscribed) { $heading = sprintf(lang('Unsubscribe %s'), name($sub)); $body = sprintf($body, "Please confirm, you want to unsubscribe <a href='" . $userquery->profile_link($sub) . "'>" . name($sub) . '</a>'); } else { $continue = false; } } if ($continue === true) { $javascript = '<script>$( document ).ready( function(){ cb_confirm( "' . $heading . '","' . $body . '",function(){ window.location="' . $url . '" }) } )</script>';
the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ if (isset($_POST['save_login'])) { $username = pg_escape_string($_POST['login_user']); $row = pg_fetch_row(pg_query($dbconn, "select u.id, u.password from \"user\" as u where u.username='******'")) or die("You don't exist, go away."); if ($row[1] != md5($_POST['login_password'])) { die("You don't exist, go away."); } $_SESSION['user'] = $row[0]; header("Status: 303 See Other"); header("Location: " . $_SERVER["SCRIPT_NAME"] . '?' . queryString(queryConstruct(array('view' => 'categories')))); exit(1); } if (isset($_POST['save_logout'])) { session_start(); session_unset(); header("Status: 303 See Other"); header("Location: " . $_SERVER["SCRIPT_NAME"] . '?' . queryString(queryConstruct(array('view' => 'login')))); exit(1); }
the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ?> <form action="<?php echo $_SERVER["SCRIPT_NAME"] . '?' . queryString(queryConstruct()); ?> " method="post" enctype="multipart/form-data"> <?php echo "<h2>" . T_("Name") . "</h2>\n"; echo "<table>\n"; echo drawInputRow(T_("Username"), $user_username); echo drawInputRow(T_("Given name"), "<input name='user_givenname' type='text' value='{$user_givenname}' />"); echo drawInputRow(T_("Surname"), "<input name='user_surname' type='text' value='{$user_surname}' />"); echo "</table>\n"; echo "<h2>" . T_("Password") . "</h2>\n"; echo "<table>\n"; echo drawInputRow(T_("New password"), "<input name='user_password1' type='password' />"); echo drawInputRow(T_("Retype password"), "<input name='user_password2' type='password' />"); echo "</table>\n"; ?>