當前位置: 首頁>>代碼示例>>PHP>>正文


PHP URL::remove方法代碼示例

本文整理匯總了PHP中URL::remove方法的典型用法代碼示例。如果您正苦於以下問題:PHP URL::remove方法的具體用法?PHP URL::remove怎麽用?PHP URL::remove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在URL的用法示例。


在下文中一共展示了URL::remove方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: URL

to go back to WriteToThem.
</big></strong></p>
<?php 
        }
        ?>
<p>Please note that this search is only for the exact word/phrase entered.
For example, putting in 'autism' won't return results for 'autistic spectrum disorder',
you will have to search for it separately.</p>
<table><tr><th>Number of occurences</th><th><?php 
        if ($wtt) {
            print 'Speaker';
        } else {
            $URL = new URL($this_page);
            $url_l = $URL->generate('html', array('house' => 2));
            $url_c = $URL->generate('html', array('house' => 1));
            $URL->remove(array('house'));
            $url_b = $URL->generate();
            if ($q_house == 1) {
                print 'Representatives | <a href="' . $url_l . '">Senators</a> | <a href="' . $url_b . '">Both</a>';
            } elseif ($q_house == 2) {
                print '<a href="' . $url_c . '">Representatives</a> | Senators | <a href="' . $url_b . '">Both</a>';
            } else {
                print '<a href="' . $url_c . '">Representatives</a> | <a href="' . $url_l . '">Senators</a> | Both';
            }
        }
        ?>
</th><th>Date range</th></tr>
<?php 
        foreach ($data['speakers'] as $pid => $speaker) {
            print '<tr><td align="center">';
            print $speaker['count'] . '</td><td>';
開發者ID:leowmjw,項目名稱:twfy,代碼行數:31,代碼來源:mobile.php

示例2: array

 function _get_listurl($id_data, $url_args = array(), $encode = 'html')
 {
     global $hansardmajors;
     // Generates an item's listurl - this is the 'contextual' url
     // for an item, in the full list view with an anchor (if appropriate).
     // $id_data is like this:
     //		$id_data = array (
     //		'major' 		=> 1,
     //		'htype' 		=> 12,
     //		'gid' 			=> 2003-10-30.421.4h2,
     //		'section_id'	=> 345,
     //		'subsection_id'	=> 346
     // );
     // $url_args is an array of other key/value pairs to be appended in the GET string.
     if ($id_data['major']) {
         $LISTURL = new URL($hansardmajors[$id_data['major']]['page_all']);
     } else {
         $LISTURL = new URL('wrans');
     }
     $fragment = '';
     if ($id_data['htype'] == '11' || $id_data['htype'] == '10') {
         if ($this->major == 6) {
             $id = preg_replace('#^.*?_.*?_#', '', $id_data['gid']);
             $fragment = $this->url . '/' . $id;
             $LISTURL->remove(array('id'));
         } else {
             $LISTURL->insert(array('id' => $id_data['gid']));
         }
     } else {
         // A debate speech or question/answer, etc.
         // We need to get the gid of the parent (sub)section for this item.
         // We use this with the gid of the item itself as an #anchor.
         $parent_epobject_id = $id_data['subsection_id'];
         // Find the gid of this item's (sub)section.
         $parent_gid = '';
         if (isset($this->epobjectid_to_gid[$parent_epobject_id])) {
             // We've previously cached the gid for this epobject_id, so use that.
             $parent_gid = $this->epobjectid_to_gid[$parent_epobject_id];
         } else {
             // We haven't cached the gid, so fetch from db.
             $r = $this->db->query("SELECT gid\n\t\t\t\t\t\t\t\tFROM \thansard\n\t\t\t\t\t\t\t\tWHERE\tepobject_id = '" . mysql_escape_string($parent_epobject_id) . "'\n\t\t\t\t\t\t\t\t");
             if ($r->rows() > 0) {
                 // Remove the "uk.org.publicwhip/blah/" from the gid:
                 // (In includes/utility.php)
                 $parent_gid = fix_gid_from_db($r->field(0, 'gid'));
                 // Cache it for if we need it again:
                 $this->epobjectid_to_gid[$parent_epobject_id] = $parent_gid;
             }
         }
         if ($parent_gid != '') {
             // We have a gid so add to the URL.
             $LISTURL->insert(array('id' => $parent_gid));
             // Use a truncated form of this item's gid for the anchor.
             $fragment = '#g' . gid_to_anchor($id_data['gid']);
         }
     }
     if (count($url_args) > 0) {
         $LISTURL->insert($url_args);
     }
     return $LISTURL->generate($encode) . $fragment;
 }
開發者ID:rhaleblian,項目名稱:twfy,代碼行數:61,代碼來源:hansardlist.php

示例3: ceil

    function page_links($pagedata)
    {
        // The next/prev and page links for the search page.
        global $this_page;
        // $pagedata has...
        $total_results = $pagedata['total_results'];
        $results_per_page = $pagedata['results_per_page'];
        $page = $pagedata['page'];
        if ($total_results > $results_per_page) {
            $numpages = ceil($total_results / $results_per_page);
            $pagelinks = array();
            // How many links are we going to display on the page - don't want to
            // display all of them if we have 100s...
            if ($page < 10) {
                $firstpage = 1;
                $lastpage = 10;
            } else {
                $firstpage = $page - 10;
                $lastpage = $page + 9;
            }
            if ($firstpage < 1) {
                $firstpage = 1;
            }
            if ($lastpage > $numpages) {
                $lastpage = $numpages;
            }
            // Generate all the page links.
            $URL = new URL($this_page);
            $URL->insert(array('wtt' => get_http_var('wtt')));
            for ($n = $firstpage; $n <= $lastpage; $n++) {
                if ($n > 1) {
                    $URL->insert(array('p' => $n));
                } else {
                    // No page number for the first page.
                    $URL->remove(array('p'));
                }
                if (isset($pagedata['pid'])) {
                    $URL->insert(array('pid' => $pagedata['pid']));
                }
                if ($n != $page) {
                    $pagelinks[] = '<a href="' . $URL->generate() . '">' . $n . '</a>';
                } else {
                    $pagelinks[] = "<strong>{$n}</strong>";
                }
            }
            // Display everything.
            ?>
				<div class="pagelinks">
					Result page: 
<?php 
            if ($page != 1) {
                $prevpage = $page - 1;
                $URL->insert(array('p' => $prevpage));
                ?>
					<big><strong><a href="<?php 
                echo $URL->generate();
                ?>
"><big>&laquo;</big> Previous</a></strong></big>
<?php 
            }
            echo "\t\t\t\t" . implode(' ', $pagelinks);
            if ($page != $numpages) {
                $nextpage = $page + 1;
                $URL->insert(array('p' => $nextpage));
                ?>

					<big><strong><a href="<?php 
                echo $URL->generate();
                ?>
">Next <big>&raquo;</big></a></strong></big> <?php 
            }
            ?>

				</div>
<?php 
        }
    }
開發者ID:archoo,項目名稱:twfy,代碼行數:77,代碼來源:page.php

示例4:

            
            <tr>
                <td class="code"><code>$url->args()</code></td>
                <td rowspan="2"><?php 
print_r($url->args());
?>
</td>
            </tr>
            <tr>
                <td class="note">get args</td>                
            </tr>
            
            <tr>
                <td class="code"><code>$url->remove('z')</code></td>
                <td rowspan="2"><?php 
echo $url->remove('z');
?>
</td>
            </tr>
            <tr>
                <td class="note">remove z</td>                
            </tr>
            
            <tr>
                <td class="code"><code>$url->remove()</code></td>
                <td rowspan="2"><?php 
echo $url->remove();
?>
</td>
            </tr>
            <tr>
開發者ID:Jonathan-Law,項目名稱:fhd,代碼行數:30,代碼來源:url-sample.php

示例5: URL

<?php 
        }
        ?>
<p>Please note that this search is only for the exact word/phrase entered.
For example, putting in 'autism' won't return results for 'autistic spectrum disorder',
you will have to search for it separately.</p>
<table><tr><th>Number of occurences</th><th><?php 
        if ($wtt) {
            print 'Speaker';
        } else {
            ?>
Table includes - <?php 
            $URL = new URL($this_page);
            $url_l = $URL->generate('html', array('house' => 2));
            $url_c = $URL->generate('html', array('house' => 1));
            $URL->remove('house');
            $url_b = $URL->generate();
            if ($q_house == 1) {
                print 'MPs | <a href="' . $url_l . '">Lords</a> | <a href="' . $url_b . '">Both</a>';
            } elseif ($q_house == 2) {
                print '<a href="' . $url_c . '">MPs</a> | Lords | <a href="' . $url_b . '">Both</a>';
            } else {
                print '<a href="' . $url_c . '">MPs</a> | <a href="' . $url_l . '">Lords</a> | Both';
            }
        }
        ?>
</th><th>Date range</th></tr>
<?php 
        foreach ($data['speakers'] as $pid => $speaker) {
            print '<tr><td align="center">';
            print $speaker['count'] . '</td><td>';
開發者ID:bruno,項目名稱:openaustralia-app,代碼行數:31,代碼來源:index.php

示例6: display_section_or_speech

 protected function display_section_or_speech($args = array())
 {
     global $DATA, $this_page, $THEUSER;
     # += as we *don't* want to override any already supplied argument
     $args += array('gid' => get_http_var('id'), 's' => get_http_var('s'), 'member_id' => get_http_var('m'));
     if (preg_match('/speaker:(\\d+)/', get_http_var('s'), $mmm)) {
         $args['person_id'] = $mmm[1];
     }
     try {
         $data = $this->list->display('gid', $args, 'none');
     } catch (\RedirectException $e) {
         $URL = new \URL($this->major_data['page_all']);
         if ($this->major == 6) {
             # Magically (as in I can't remember quite why), pbc_clause will
             # contain the new URL without any change...
             $URL->remove(array('id'));
         } else {
             $URL->insert(array('id' => $e->getMessage()));
         }
         # put the search term back in so highlighting works.
         # NB: as we don't see the # part of the URL we lose this :(
         if ($args['s'] !== '') {
             $URL->insert(array('s' => $args['s']));
         }
         redirect($URL->generate('none'));
     }
     $data['individual_item'] = $this->list->commentspage == $this_page;
     if ($data['individual_item']) {
         $COMMENTLIST = new \COMMENTLIST();
         $args['user_id'] = get_http_var('u');
         $args['epobject_id'] = $this->list->epobject_id();
         $data['comments']['object'] = $COMMENTLIST;
         $data['comments']['args'] = $args;
         $data['comments']['commentdata'] = array('epobject_id' => $this->list->epobject_id(), 'gid' => get_http_var('id'), 'return_page' => $this_page);
     }
     if (!isset($data['info'])) {
         header("HTTP/1.0 404 Not Found");
         exit;
         # XXX
     }
     # Okay, let's set up highlighting and glossarisation
     $SEARCHENGINE = null;
     if (isset($data['info']['searchstring']) && $data['info']['searchstring'] != '') {
         $SEARCHENGINE = new \SEARCHENGINE($data['info']['searchstring']);
     }
     // Before we print the body text we need to insert glossary links
     // and highlight search string words.
     $speeches = 0;
     $bodies = array();
     foreach ($data['rows'] as $row) {
         $htype = $row['htype'];
         if ($htype == 12 || $htype == 13) {
             $speeches++;
         }
         $body = $row['body'];
         $body = preg_replace('#<phrase class="honfriend" id="uk.org.publicwhip/member/(\\d+)" name="([^"]*?)">(.*?\\s*\\((.*?)\\))</phrase>#', '<a href="/mp/?m=$1" title="Our page on $2 - \'$3\'">$4</a>', $body);
         $body = preg_replace_callback('#<phrase class="offrep" id="(.*?)/(\\d+)-(\\d+)-(\\d+)\\.(.*?)">(.*?)</phrase>#', function ($matches) {
             return '<a href="/search/?pop=1&s=date:' . $matches[2] . $matches[3] . $matches[4] . '+column:' . $matches[5] . '+section:' . $matches[1] . '">' . str_replace("Official Report", "Hansard", $matches[6]) . '</a>';
         }, $body);
         #$body = preg_replace('#<phrase class="offrep" id="((.*?)/(\d+)-(\d+)-(\d+)\.(.*?))">(.*?)</phrase>#e', "\"<a href='/search/?pop=1&amp;s=date:$3$4$5+column:$6+section:$2&amp;match=$1'>\" . str_replace('Official Report', 'Hansard', '$7') . '</a>'", $body);
         $bodies[] = $body;
     }
     // Do all this unless the glossary is turned off in the URL
     if (get_http_var('ug') != 1) {
         // And glossary phrases
         twfy_debug_timestamp('Before glossarise');
         $args['sort'] = "regexp_replace";
         $GLOSSARY = new \GLOSSARY($args);
         $bodies = $GLOSSARY->glossarise($bodies, 1);
         twfy_debug_timestamp('After glossarise');
     }
     if ($SEARCHENGINE) {
         // We have some search terms to highlight.
         twfy_debug_timestamp('Before highlight');
         $bodies = $SEARCHENGINE->highlight($bodies);
         twfy_debug_timestamp('After highlight');
     }
     $first_speech = null;
     $data['section_title'] = '';
     $subsection_title = '';
     for ($i = 0; $i < count($data['rows']); $i++) {
         $row = $data['rows'][$i];
         $htype = $row['htype'];
         // HPOS should be defined below if it's needed; otherwise default to 0
         $heading_hpos = 0;
         if ($htype == 10) {
             $data['section_title'] = $row['body'];
             $heading_hpos = $row['hpos'];
         } elseif ($htype == 11) {
             $subsection_title = $row['body'];
             $heading_hpos = $row['hpos'];
         } elseif ($htype == 12) {
             # Splitting out highlighting results back into individual bits
             $data['rows'][$i]['body'] = $bodies[$i];
         }
         if ($htype == 12 || $htype == 13) {
             if (!$first_speech) {
                 $first_speech = $data['rows'][$i];
             }
             # Voting links
//.........這裏部分代碼省略.........
開發者ID:sarahs-synapse,項目名稱:theyworkforyou,代碼行數:101,代碼來源:SectionView.php

示例7: _get_listurl

 public function _get_listurl($id_data, $url_args = array(), $encode = 'html')
 {
     global $hansardmajors;
     // Generates an item's listurl - this is the 'contextual' url
     // for an item, in the full list view with an anchor (if appropriate).
     // $id_data is like this:
     //		$id_data = array (
     //		'major' 		=> 1,
     //		'htype' 		=> 12,
     //		'gid' 			=> 2003-10-30.421.4h2,
     //		'section_id'	=> 345,
     //		'subsection_id'	=> 346
     // );
     // $url_args is an array of other key/value pairs to be appended in the GET string.
     if ($id_data['major']) {
         $LISTURL = new URL($hansardmajors[$id_data['major']]['page_all']);
     } else {
         $LISTURL = new URL('wrans');
     }
     $fragment = '';
     if ($id_data['htype'] == '11' || $id_data['htype'] == '10') {
         if ($this->major == 6) {
             $id = preg_replace('#^.*?_.*?_#', '', $id_data['gid']);
             global $DATA;
             $DATA->set_page_metadata('pbc_clause', 'url', 'pbc/' . $this->url . $id);
             $LISTURL->remove(array('id'));
         } else {
             $LISTURL->insert(array('id' => $id_data['gid']));
         }
     } else {
         // A debate speech or question/answer, etc.
         // We need to get the gid of the parent (sub)section for this item.
         // We use this with the gid of the item itself as an #anchor.
         $parent_epobject_id = $id_data['subsection_id'];
         $minor = $id_data['minor'];
         // Find the gid of this item's (sub)section.
         $parent_gid = '';
         if (isset($this->epobjectid_to_gid[$parent_epobject_id])) {
             // We've previously cached the gid for this epobject_id, so use that.
             $parent_gid = $this->epobjectid_to_gid[$parent_epobject_id];
         } else {
             // We haven't cached the gid, so fetch from db.
             $r = $this->db->query("SELECT gid\n                                FROM \thansard\n                                WHERE\tepobject_id = :epobject_id", array(':epobject_id' => $parent_epobject_id));
             if ($r->rows() > 0) {
                 // Remove the "uk.org.publicwhip/blah/" from the gid:
                 // (In includes/utility.php)
                 $parent_gid = fix_gid_from_db($r->field(0, 'gid'));
                 // Cache it for if we need it again:
                 $this->epobjectid_to_gid[$parent_epobject_id] = $parent_gid;
             }
         }
         if ($parent_gid != '') {
             // We have a gid so add to the URL.
             if ($id_data['major'] == 6) {
                 if (isset($this->bill_lookup[$minor])) {
                     list($title, $session) = $this->bill_lookup[$minor];
                 } else {
                     $qq = $this->db->query('select title, session from bills where id=' . $minor);
                     $title = $qq->field(0, 'title');
                     $session = $qq->field(0, 'session');
                     $this->bill_lookup[$minor] = array($title, $session);
                 }
                 $url = "{$session}/" . urlencode(str_replace(' ', '_', $title));
                 $parent_gid = preg_replace('#^.*?_.*?_#', '', $parent_gid);
                 global $DATA;
                 $DATA->set_page_metadata('pbc_clause', 'url', "pbc/{$url}/{$parent_gid}");
                 $LISTURL->remove(array('id'));
             } else {
                 $LISTURL->insert(array('id' => $parent_gid));
             }
             // Use a truncated form of this item's gid for the anchor.
             $fragment = '#g' . gid_to_anchor($id_data['gid']);
         }
     }
     if (count($url_args) > 0) {
         $LISTURL->insert($url_args);
     }
     return $LISTURL->generate($encode) . $fragment;
 }
開發者ID:udp12,項目名稱:theyworkforyou,代碼行數:79,代碼來源:hansardlist.php

示例8: display_section_or_speech

 protected function display_section_or_speech($args = array())
 {
     global $DATA, $this_page, $THEUSER;
     # += as we *don't* want to override any already supplied argument
     $args += array('gid' => get_http_var('id'), 's' => get_http_var('s'), 'member_id' => get_http_var('m'));
     if (preg_match('/speaker:(\\d+)/', get_http_var('s'), $mmm)) {
         $args['person_id'] = $mmm[1];
     }
     try {
         $data = $this->list->display('gid', $args, 'none');
     } catch (\RedirectException $e) {
         $URL = new \URL($this->major_data['page_all']);
         if ($this->major == 6) {
             # Magically (as in I can't remember quite why), pbc_clause will
             # contain the new URL without any change...
             $URL->remove(array('id'));
         } else {
             $URL->insert(array('id' => $e->getMessage()));
         }
         # put the search term back in so highlighting works.
         # NB: as we don't see the # part of the URL we lose this :(
         if ($args['s'] !== '') {
             $URL->insert(array('s' => $args['s']));
         }
         redirect($URL->generate('none'));
     }
     $data['individual_item'] = $this->list->commentspage == $this_page;
     if ($data['individual_item']) {
         $COMMENTLIST = new \COMMENTLIST();
         $args['user_id'] = get_http_var('u');
         $args['epobject_id'] = $this->list->epobject_id();
         $data['comments']['object'] = $COMMENTLIST;
         $data['comments']['args'] = $args;
         $data['comments']['commentdata'] = array('epobject_id' => $this->list->epobject_id(), 'gid' => get_http_var('id'), 'return_page' => $this_page);
     }
     if (!isset($data['info'])) {
         header("HTTP/1.0 404 Not Found");
         $data['template'] = 'error';
         return $data;
     }
     # Okay, let's set up highlighting and glossarisation
     list($bodies, $speeches) = $this->highlightSpeeches($data);
     list($data, $first_speech, $subsection_title) = $this->annotateSpeeches($data, $bodies, $speeches);
     list($country, $location, $assembly) = $this->getCountryDetails();
     $data['location'] = $location;
     $data['current_assembly'] = $assembly;
     $data = $this->setTitleAndAlertText($data, $subsection_title);
     $data['debate_time_human'] = format_time($first_speech['htime'], 'g:i a');
     $data['debate_day_human'] = format_date($first_speech['hdate'], 'jS F Y');
     $URL = new \URL($this->list->listpage);
     $URL->insert(array('d' => $first_speech['hdate']));
     $URL->remove(array('id'));
     $data['debate_day_link'] = $URL->generate();
     $data['nextprev'] = $DATA->page_metadata($this_page, 'nextprev');
     return $data;
 }
開發者ID:vijo,項目名稱:theyworkforyou,代碼行數:56,代碼來源:SectionView.php

示例9: display_form

function display_form($COMMENT, $errors = array())
{
    global $this_page, $THEUSER, $PAGE;
    ?>
				<p>Here's the comment you're reporting. Please enter a brief reason why you think it should be deleted in the form beneath. Thanks for your help!</p>
<?php 
    // First display the comment.
    $COMMENT->display();
    // Now display the form.
    $FORMURL = new URL($this_page);
    $FORMURL->remove(array('id'));
    ?>
				<br>
				<form action="<?php 
    echo $FORMURL->generate();
    ?>
" method="post">
<?php 
    if ($THEUSER->isloggedin()) {
        ?>
				<p><br><strong>From:</strong> <?php 
        echo htmlentities($THEUSER->firstname() . ' ' . $THEUSER->lastname());
        ?>
</p>
<?php 
    } else {
        // Not-logged-in user, so we want their name and email address.
        if (isset($errors['name'])) {
            $PAGE->error_message($errors['name']);
        }
        ?>
				<div class="row">
				<span class="label"><label for="firstname">Your first name:</label></span>
				<span class="formw"><input type="text" name="firstname" id="firstname" value="" maxlength="50" size="30" class="form"></span>
				</div>

				<div class="row">
				<span class="label"><label for="lastname">Your last name:</label></span>

				<span class="formw"><input type="text" name="lastname" id="lastname" value="" maxlength="50" size="30" class="form"></span>
				</div>
<?php 
        if (isset($errors['email'])) {
            $PAGE->error_message($errors['email']);
        }
        ?>
				<div class="row">
				<span class="label"><label for="em">Email address:</label></span>
				<span class="formw"><input type="text" name="em" id="em" value="" maxlength="100" size="30" class="form"></span>
				</div>
<?php 
    }
    if (isset($errors['body'])) {
        $PAGE->error_message($errors['body']);
    }
    $RULESURL = new URL('houserules');
    ?>
				<p style="clear: left;"><strong>Why should this comment be deleted?</strong><br>
				<small>Check our <a href="<?php 
    echo $RULESURL->generate();
    ?>
">House Rules</a> and tell us why the comment breaks them.</small><br>
				<textarea name="body" rows="10" cols="45"><?php 
    echo htmlentities(get_http_var('body'));
    ?>
</textarea></p>
		
				<div class="row">
				<span class="label">&nbsp;</span>
				<span class="formw"><input type="submit" value="Send report"></span>
				</div>
				
				<input type="hidden" name="submitted" value="true">
				<input type="hidden" name="id" value="<?php 
    echo htmlentities($COMMENT->comment_id());
    ?>
">
<?php 
    if (get_http_var('ret') != '') {
        // Where the user came from to get here.
        ?>
				<input type="hidden" name="ret" value="<?php 
        echo htmlentities(get_http_var('ret'));
        ?>
">
<?php 
    }
    ?>
				</form>

<?php 
}
開發者ID:leowmjw,項目名稱:twfy,代碼行數:92,代碼來源:index.php

示例10: search_order_p

function search_order_p($searchstring)
{
    global $DATA, $PAGE, $this_page;
    $q_house = '';
    if (ctype_digit(get_http_var('house'))) {
        $q_house = get_http_var('house');
    }
    # Fetch the results
    $data = search_by_usage($searchstring, $q_house);
    $wtt = get_http_var('wtt');
    if ($wtt) {
        $pagetitle = 'League table of Lords who say ' . $data['pagetitle'];
    } else {
        $pagetitle = 'Who says ' . $data['pagetitle'] . ' the most?';
    }
    $DATA->set_page_metadata($this_page, 'title', $pagetitle);
    $PAGE->page_start();
    $PAGE->stripe_start();
    $PAGE->search_form($searchstring);
    if (isset($data['error'])) {
        print '<p>' . $data['error'] . '</p>';
        return;
    }
    if (isset($data['limit_reached'])) {
        print '<p><em>This service runs on a maximum number of 5,000 results, to conserve memory</em></p>';
    }
    print "\n\n<!-- ";
    foreach ($data['party_count'] as $party => $count) {
        print "{$party}:{$count}<br>";
    }
    print " -->\n\n";
    if ($wtt) {
        ?>
<p><strong><big>Now, try reading what a couple of these Lords are saying,
to help you find someone appropriate. When you've found someone,
hit the "I want to write to this Lord" button on their results page
to go back to WriteToThem.
</big></strong></p>
<?php 
    }
    ?>
<p>Please note that this search is only for the exact word/phrase entered.
For example, putting in 'autism' won't return results for 'autistic spectrum disorder',
you will have to search for it separately.</p>
<table><tr><th>Number of occurences</th><th><?php 
    if ($wtt) {
        print 'Speaker';
    } else {
        ?>
Table includes - <?php 
        $URL = new URL($this_page);
        $url_l = $URL->generate('html', array('house' => 2));
        $url_c = $URL->generate('html', array('house' => 1));
        $URL->remove(array('house'));
        $url_b = $URL->generate();
        if ($q_house == 1) {
            print 'MPs | <a href="' . $url_l . '">Lords</a> | <a href="' . $url_b . '">Both</a>';
        } elseif ($q_house == 2) {
            print '<a href="' . $url_c . '">MPs</a> | Lords | <a href="' . $url_b . '">Both</a>';
        } else {
            print '<a href="' . $url_c . '">MPs</a> | <a href="' . $url_l . '">Lords</a> | Both';
        }
    }
    ?>
</th><th>Date range</th></tr>
<?php 
    foreach ($data['speakers'] as $pid => $speaker) {
        print '<tr><td align="center">';
        print $speaker['count'] . '</td><td>';
        if ($pid) {
            $house = $speaker['house'];
            $left = $speaker['left'];
            if ($house == 1) {
                print '<span style="color:#009900">&bull;</span> ';
            } elseif ($house == 2) {
                print '<span style="color:#990000">&bull;</span> ';
            }
            if (!$wtt || $left == '9999-12-31') {
                print '<a href="' . WEBPATH . 'search/?s=' . urlencode($searchstring) . '&amp;pid=' . $pid;
            }
            if ($wtt && $left == '9999-12-31') {
                print '&amp;wtt=2';
            }
            if (!$wtt || $left == '9999-12-31') {
                print '">';
            }
        }
        print $speaker['name'];
        if ($pid) {
            print '</a>';
        }
        if ($speaker['party']) {
            print ' (' . $speaker['party'] . ')';
        }
        if (isset($speaker['office'])) {
            print ' - ' . join('; ', $speaker['office']);
        }
        print '</td> <td>';
        $pmindate = $speaker['pmindate'];
        $pmaxdate = $speaker['pmaxdate'];
//.........這裏部分代碼省略.........
開發者ID:sarahs-synapse,項目名稱:theyworkforyou,代碼行數:101,代碼來源:index.php

示例11: elseif

    $committee->display('bill', $args);
} elseif ($bill_id && $id) {
    # Display the debate for a particular clause
    $this_page = 'pbc_clause';
    $args = array('gid' => $standingprefix . $id, 's' => get_http_var('s'), 'member_id' => get_http_var('m'), 'glossarise' => 1, 'sort' => 'regexp_replace', 'bill_id' => $bill_id, 'bill_title' => $bill, 'bill_session' => $session);
    $GLOSSARY = new GLOSSARY($args);
    # Why a global?
    if (preg_match('/speaker:(\\d+)/', get_http_var('s'), $mmm)) {
        $args['person_id'] = $mmm[1];
    }
    $result = $committee->display('gid', $args);
    # If it is a redirect, change URL. Magically (as in I can't remember
    # quite why), pbc_clause will contain the new URL without any change...
    if (is_string($result)) {
        $URL = new URL('pbc_clause');
        $URL->remove(array('id'));
        header('Location: http://' . DOMAIN . $URL->generate('none'), true, 301);
        exit;
    }
    /* This section below is shared between here and everywhere else - factor it out! */
    if ($committee->htype() == '12' || $committee->htype() == '13') {
        $PAGE->stripe_start('side', 'comments');
        $COMMENTLIST = new COMMENTLIST();
        $args['user_id'] = get_http_var('u');
        $args['epobject_id'] = $committee->epobject_id();
        $COMMENTLIST->display('ep', $args);
        $PAGE->stripe_end();
        $PAGE->stripe_start('side', 'addcomment');
        $commendata = array('epobject_id' => $committee->epobject_id(), 'gid' => get_http_var('id'), 'return_page' => $this_page);
        $PAGE->comment_form($commendata);
        if ($THEUSER->isloggedin()) {
開發者ID:palfrey,項目名稱:twfy,代碼行數:31,代碼來源:index.php

示例12: get_search_url

 protected function get_search_url($params = true)
 {
     global $this_page;
     $url = new \URL($this_page);
     if (isset($this->searchstring)) {
         $value = $this->searchstring;
         if (preg_match_all('#speaker:(\\d+)#', $value, $m) == 1) {
             $person_id = $m[1][0];
             $value = str_replace('speaker:' . $person_id, '', $value);
             $url->insert(array('pid' => $person_id));
         }
         $url->insert(array('q' => $value));
     }
     if ($params) {
         if (get_http_var('house')) {
             $url->insert(array('house' => get_http_var('house')));
         }
         if (get_http_var('wtt')) {
             $url->insert(array('wtt' => get_http_var('wtt')));
         }
     } else {
         $url->remove(array('o', 'house'));
     }
     return $url;
 }
開發者ID:udp12,項目名稱:theyworkforyou,代碼行數:25,代碼來源:Search.php

示例13: addUrlsToData

 private function addUrlsToData()
 {
     global $this_page;
     $urls = array();
     $URL = new \URL($this_page);
     $urls['plain'] = $URL->generate();
     $URL->insert(array('o' => 'n'));
     $urls['by_name'] = $URL->generate();
     $URL->insert(array('o' => 'l'));
     $urls['by_last'] = $URL->generate();
     $URL->insert(array('o' => 'f'));
     $urls['by_first'] = $URL->generate();
     $URL->insert(array('o' => 'p'));
     $urls['by_party'] = $URL->generate();
     $URL->insert(array('f' => 'csv'));
     $URL->remove(array('o'));
     if ($date = get_http_var('date')) {
         $URL->insert(array('date' => $date));
     }
     $urls['by_csv'] = $URL->generate();
     return $urls;
 }
開發者ID:vijo,項目名稱:theyworkforyou,代碼行數:22,代碼來源:People.php


注:本文中的URL::remove方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。