/** * @author Z.Hron * @name get_url_for * @brief This function build query string from array of key=>value params * @return url * * */ function get_url_for($url, $params) { foreach ($params as $key => $value) { $url = add_querystring_var($url, $key, $value); } return $url; }
public function getNavigation($url, $css_class, $limit = 24, $separator = ' ยป ') { $navigation = array(); $navigation[] = $this->category->getNavigation($url, $css_class, $limit, $separator); $this_link = add_querystring_var($url, "forum_id", $this->id); $text = $this->title; if (strlen($text) > $limit) { $text = substr($text, 0, $limit - 3) . "..."; } $navigation[] = $this->get_a_tag($this_link, $css_class, $text); return implode($separator, $navigation); }
function amr_format_tz($tzstring) { global $amr_globaltz, $amr_options; $url = esc_url_raw($_SERVER['REQUEST_URI']); $tz = timezone_name_get($amr_globaltz); if ($tz === $tzstring) { $tz2 = date_default_timezone_get(); } else { $tz2 = $tzstring; } if ($tz2 === $tz) { $tz2 = 'UTC'; } $text1 = __('Change Timezone', 'amr-ical-events-list'); $text2 = sprintf(__('Timezone: %s, Click for %s', 'amr-ical-events-list'), $tz, $tz2); if (isset($amr_options['no_images']) and $amr_options['no_images']) { $t3 = $text1; } else { $t3 = '<img title = "' . $text2 . '" src="' . IMAGES_LOCATION . TIMEZONEIMAGE . '" class="amr-bling" alt="' . $text1 . '" />'; } return '<a class="timezone amr-bling" href="' . htmlentities(add_querystring_var($url, 'tz', $tz2)) . '" title="' . $text2 . '" >' . $t3 . ' </a>'; }
} //echo('nav_cat_id: ' .$nav_cat_id); $prev = mbudm_get_previous_artwork($post->ID, $nav_cat_id); if ($prev) { $imgdata = mbudm_get_post_image_tag_and_caption($prev, MBUDM_IMAGESIZE_2); $url = add_querystring_var(get_permalink($prev), 'mb_action', 'prev'); $url = add_querystring_var($url, 'mb_cat', $nav_cat_id); $prevMarkup = '<a class="prev" href="' . $url . '" title="Previous Artwork in ' . $nav_cat_term . ': ' . $imgdata['caption'] . '" ><span>' . $imgdata['tag'] . '</span></a>'; } else { $prevMarkup = ''; } $next = mbudm_get_next_artwork($post->ID, $nav_cat_id); if ($next) { $imgdata = mbudm_get_post_image_tag_and_caption($next, MBUDM_IMAGESIZE_2); $url = add_querystring_var(get_permalink($next), 'mb_action', 'next'); $url = add_querystring_var($url, 'mb_cat', $nav_cat_id); $nextMarkup = '<a class="next" href="' . $url . '" title="Next Artwork in ' . $nav_cat_term . ': ' . $imgdata['caption'] . '" ><span>' . $imgdata['tag'] . '</span></a>'; } else { $nextMarkup = ''; } echo $prevMarkup . $nextMarkup; ?> <div id="artwork-wrap" class="container_24"> <?php $existing_attachments = get_post_meta($post->ID, '_attachments', false); $post_attachments = array(); $thumb_id = get_post_thumbnail_id($post->ID); if (is_array($existing_attachments) && count($existing_attachments) > 0) { foreach ($existing_attachments as $attachment) { // decode and unserialize the data $data = unserialize(base64_decode($attachment));
function mbudm_get_image($img_id = null, $image_size = null, $post_link = false, $gridClass = '') { if ($img_id == null) { return; } if ($image_size == null) { $image_size = MBUDM_IMAGESIZE_12; } $imgdata = mbudm_get_image_tag_and_caption(get_the_ID(), $img_id, $image_size); $url_tag_open = $post_link; if ($url_tag_open) { //add a link to the post with the image id as a param $p_url = add_querystring_var(get_permalink(), 'mb_aid', $img_id); $url_tag_open = '<a href="' . $p_url . '" title="' . $imgdata['caption'] . '" >'; } return mbudm_render_image($imgdata, $url_tag_open, $gridClass); }
public function getPaggingLinks($base_url, $page_key, $css_class, $css_class_selected, $icons = null) { $html = null; if (isset($this->pagging['first']) && !is_null($this->pagging['first'])) { // add_querystring_var() function defined in functions.php $url = add_querystring_var($base_url, $page_key, $this->pagging['first']); if (isset($icons['first'])) { $text = $this->get_img_tag($icons['first'], $css_class); } else { $text = "<<"; } $html .= $this->get_a_tag($url, $css_class, $text) . "\r\n"; } if (isset($this->pagging['prev']) && !is_null($this->pagging['prev'])) { $url = add_querystring_var($base_url, $page_key, $this->pagging['prev']); if (isset($icons['prev'])) { $text = $this->get_img_tag($icons['prev'], $css_class); } else { $text = "<"; } $html .= $this->get_a_tag($url, $css_class, $text) . "\r\n"; } if (isset($this->pagging['pages'])) { foreach ($this->pagging['pages'] as $page_n) { $_css_class = $page_n == $this->pagging['selected'] ? $css_class_selected : $css_class; $url = add_querystring_var($base_url, $page_key, $page_n); $html .= $this->get_a_tag($url, $_css_class, (string) $page_n) . "\r\n"; } } if (isset($this->pagging['next']) && !is_null($this->pagging['next'])) { $url = add_querystring_var($base_url, $page_key, $this->pagging['next']); if (isset($icons['next'])) { $text = $this->get_img_tag($icons['next'], $css_class); } else { $text = ">"; } $html .= $this->get_a_tag($url, $css_class, $text) . "\r\n"; } if (isset($this->pagging['last']) && !is_null($this->pagging['last'])) { $url = add_querystring_var($base_url, $page_key, $this->pagging['last']); if (isset($icons['last'])) { $text = $this->get_img_tag($icons['last'], $css_class); } else { $text = ">>"; } $html .= $this->get_a_tag($url, $css_class, $text) . "\r\n"; } return $html; }
private function get_url_for($params = array(), $_base_url = null) { $query_str = ''; $url = $_base_url ? $_base_url : $this->forums_url; foreach ($params as $name => $value) { $query_str = add_querystring_var($query_str, $name, $value); } return $url . $query_str; }
//insert $embed_sursa for ($i = 0; $i < count($embed_sursa); $i++) { if (strlen($embed_sursa[$i])) { insertIntoTable("INSERT INTO mm_sesizari_embeds SET sesizare_id = :sesizare_id, embed_sursa = :embed_sursa ", array("sesizare_id" => $sesizareId, "embed_sursa" => $embed_sursa[$i])); } } //endfor $embed_sursa //insert $selected_categs for ($i = 0; $i < count($selected_categs); $i++) { insertIntoTable("INSERT INTO mm_categs_sesizari SET sesizare_id = :sesizare_id, categ_id = :categ_id ", array("sesizare_id" => $sesizareId, "categ_id" => intval($selected_categs[$i]))); } //endfor $selected_categs //send sezisare to validation sendSesizareToApprover($sesizareId); //succes: go to Place Signature Boxes redirect(add_querystring_var($_SERVER['REQUEST_URI'], 'm', '101')); } } else { //not submited $sendAllSubmitOK = 0; $data_ora = date("Y-m-d H:00"); $selected_categs = array(); } $config['currentMenuSection'] = 'adauga'; pageHeader(); ?> <div class="container_12"> <form action="<?php echo $_SERVER['REQUEST_URI'];
<?php require_once 'includes/config.php'; $sesizare_id = intval($_GET['s']); $_SESIZARE = getQueryInArray("SELECT * FROM sesizari WHERE validated = 1 AND deleted = 0 AND sesizare_id = :sesizare_id LIMIT 1", array('sesizare_id' => $sesizare_id)); if (!count($_SESIZARE)) { redirect(add_querystring_var($config['siteURL'], 'm', '102')); } $_CATEGORII_SESIZARE = getQueryInArray("SELECT c.* FROM mm_categs_sesizari mc JOIN categories c ON mc.categ_id = c.categ_id WHERE mc.sesizare_id = :sesizare_id", array('sesizare_id' => $sesizare_id)); $_LINKURI_SESIZARE = getQueryInArray("SELECT l.* FROM mm_sesizari_linkuri l WHERE l.sesizare_id = :sesizare_id AND l.link_sursa <> '' ", array('sesizare_id' => $sesizare_id)); $_IMAGINI_SESIZARE = getQueryInArray("SELECT i.* FROM mm_sesizari_images i WHERE i.sesizare_id = :sesizare_id ", array('sesizare_id' => $sesizare_id)); $_CODURI_EMBED = getQueryInArray("SELECT e.* FROM mm_sesizari_embeds e WHERE e.sesizare_id = :sesizare_id AND e.embed_sursa <> '' ", array('sesizare_id' => $sesizare_id)); $config['currentMenuSection'] = 'index'; $config['currentSubMenuSection'] = 'sesizare'; pageHeader(); ?> <div class="container_12"> <div class="grid_7"> <h1><?php echo '<a href="' . getSesizareURL($_SESIZARE[0]['sesizare_id']) . '">' . $_SESIZARE[0]['sesizare_titlu'] . '</a>'; ?> </h1> <div class="icon_time"></div><div class="sesizareMeta"><?php echo getDataOraNice($_SESIZARE[0]['data_ora']); ?> </div> <div class="icon_location"></div><div class="sesizareMeta"><?php echo getLocationNice($_SESIZARE[0]['location_search'], $_SESIZARE[0]['location_reverse']); ?>
<?php require_once 'includes/config.php'; //get params $h = filter_var($_GET['h'], FILTER_SANITIZE_STRING); if (!strlen($h)) { redirect($config['siteURL']); } $_SESIZARE = getQueryInArray("SELECT * FROM sesizari WHERE deleted = 0 AND validation_code = :validation_code LIMIT 1", array('validation_code' => $h)); if (!count($_SESIZARE)) { redirect(add_querystring_var($config['siteURL'], 'm', '103')); } if ($_SESIZARE[0]['validated'] == 1) { redirect(add_querystring_var(getSesizareURL($_SESIZARE[0]['sesizare_id']), 'm', '104')); } else { //validare $updateTableStr = "UPDATE sesizari SET validated = :validated WHERE sesizare_id = :sesizare_id "; $updateTableArray = array('validated' => intval(1), 'sesizare_id' => $_SESIZARE[0]['sesizare_id']); updateTable($updateTableStr, $updateTableArray); //trimitere e-mail alerta catre abonati sendAlertsForSesizare($_SESIZARE[0]); //redirectare in pagina de sesizare + mesaj succes redirect(add_querystring_var(getSesizareURL($_SESIZARE[0]['sesizare_id']), 'm', '105')); }
function projectAlocaEvaluatori($_DATA) { global $configArray; // ADD REMOVE EVALUATORS ////////////////////////////////////////////////////////////////////////////// if ($_GET['cmd'] == 'add') { if (intval($_GET['id_evaluator'])) { updateTable("INSERT mm_evaluator_proiect_competitie SET id_cont = '" . intval($_GET['id_evaluator']) . "', id_proiect = '" . intval($_DATA[0]['id']) . "', id_competitie = '" . intval($_DATA[0]['id_competitie']) . "', alocat_la = '" . date("Y-m-d H:i:s") . "' "); redirect(remove_querystring_var(remove_querystring_var($_SERVER['REQUEST_URI'], 'id_evaluator'), 'cmd')); } } if ($_GET['cmd'] == 'remove') { if (intval($_GET['id_evaluator'])) { mysql_query("DELETE FROM mm_evaluator_proiect_competitie WHERE id_cont = " . intval($_GET['id_evaluator']) . " AND id_proiect = " . intval($_DATA[0]['id']) . " AND id_competitie = " . intval($_DATA[0]['id_competitie']) . " ", $configArray['dbcnx']); redirect(remove_querystring_var(remove_querystring_var($_SERVER['REQUEST_URI'], 'id_evaluator'), 'cmd')); } } $EVALUATORI = getQueryInArray("SELECT * FROM conturi_evaluatori c WHERE 1=1 AND activ = 1 AND id NOT IN (SELECT id_cont FROM mm_evaluator_proiect_competitie epc WHERE epc.id_proiect = " . intval($_DATA[0]['id']) . ") ORDER BY evaluator_strain DESC"); $EVALUATORI_ALOCATI = getQueryInArray("SELECT c.*, epc.* FROM mm_evaluator_proiect_competitie epc JOIN conturi_evaluatori c ON c.id = epc.id_cont WHERE epc.id_proiect = " . intval($_DATA[0]['id']) . " ORDER BY epc.activ DESC"); ?> <div class="container"> <?php if (count($EVALUATORI_ALOCATI)) { ?> <h2>Evaluatori Alocati:</h2> <table cellpadding="0" cellspacing="0" class="F"> <?php for ($i = 0; $i < count($EVALUATORI_ALOCATI); $i++) { ?> <tr <?php if ($EVALUATORI_ALOCATI[$i]['activ'] == 0) { echo ' class="red"'; } ?> > <td align="left" class="label"><?php echo $EVALUATORI_ALOCATI[$i]['evaluator_nume'] . ' ' . $EVALUATORI_ALOCATI[$i]['evaluator_prenume']; ?> </td> <td align="left" class="label"> <?php if ($EVALUATORI_ALOCATI[$i]['accepted'] == 0) { ?> <?php if ($EVALUATORI_ALOCATI[$i]['status'] == 'rejected') { ?> <span class="red" title="<?php echo htmlspecialchars($EVALUATORI_ALOCATI[$i]['reject_reason']); ?> ">Rejected<br />[<?php echo htmlspecialchars($EVALUATORI_ALOCATI[$i]['reject_reason']); ?> ]</span> <?php } else { ?> <a href="<?php echo add_querystring_var(add_querystring_var($_SERVER['REQUEST_URI'], 'id_evaluator', $EVALUATORI_ALOCATI[$i]['id']), 'cmd', 'remove'); ?> ">Sterge</a> <?php } ?> <?php } else { ?> <span class="green">Acceptat</span> <?php } ?> </td> <td align="left" class="label"><?php echo $EVALUATORI_ALOCATI[$i]['status']; ?> </td> <td align="left" class="label"><?php if ($EVALUATORI_ALOCATI[$i]['evaluator_strain'] == 1) { print 'strain'; } else { print 'roman'; } ?> </td> <td align="left" class="label" style="width:120px;"><?php echo $EVALUATORI_ALOCATI[$i]['evaluator_institutie']; ?> </td> </tr> <?php } //endfor ?> </table> <?php } else { ?> <h2>Nici un evaluator alocat</h2> <?php } ?> <?php if (count($EVALUATORI)) { ?> <h2>Evaluatori disponibili:</h2> <table cellpadding="0" cellspacing="0" class="F"> <tr><td colspan="4" style="text-align:left;"><strong>STRAINI:</strong></td></tr> <?php $currentStrain = $EVALUATORI[0]['evaluator_strain']; for ($i = 0; $i < count($EVALUATORI); $i++) { if ($currentStrain != $EVALUATORI[$i]['evaluator_strain']) { ?> <tr><td colspan="4" style="text-align:left;"><strong>ROMANI:</strong></td></tr> <?php $currentStrain = $EVALUATORI[$i]['evaluator_strain']; } ?> <tr> <td align="left" class="label"><?php echo $EVALUATORI[$i]['evaluator_nume'] . ' ' . $EVALUATORI[$i]['evaluator_prenume']; ?> </td> <td align="left" class="label"><a href="<?php echo add_querystring_var(add_querystring_var($_SERVER['REQUEST_URI'], 'id_evaluator', $EVALUATORI[$i]['id']), 'cmd', 'add'); ?> ">Aloca</a></td> <td align="left" class="label"><?php if ($EVALUATORI[$i]['evaluator_strain'] == 1) { print 'strain'; } else { print 'roman'; } ?> </td> <td align="left" class="label" style="width:120px;"><?php echo $EVALUATORI[$i]['evaluator_institutie']; ?> </td> </tr> <?php } ?> </table> <?php } else { ?> <h2>Nici un evaluator disponbil</h2> <?php } ?> </div> <?php // END ADD REMOVE EVALUATORS ////////////////////////////////////////////////////////////////////////////// }