本文整理汇总了PHP中PVars类的典型用法代码示例。如果您正苦于以下问题:PHP PVars类的具体用法?PHP PVars怎么用?PHP PVars使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PVars类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DBConnect
function DBConnect()
{
global $_SYSHCVOL;
CheckDBParams();
$db = mysql_connect($_SYSHCVOL['MYSQLServer'], $_SYSHCVOL['MYSQLUsername'], $_SYSHCVOL['MYSQLPassword']);
if (!$db) {
$str = "bad mysql_connect " . mysql_error();
error_log($str . $_SYSHCVOL['MYSQLServer']);
bw_error($str);
}
if (!mysql_select_db($_SYSHCVOL['MYSQLDB'], $db)) {
$str = "bad mysql_select_db " . mysql_error();
error_log($str . " select db {$_SYSHCVOL['MYSQLDB']}");
bw_error($str);
}
// Line to force use of UTF-8
// Natively dabase is sio latin1
mysql_query("SET NAMES 'utf8'");
mysql_query("SET CHARACTER SET 'utf8'");
mysql_query("SET collation_connection='utf8_general_ci'");
global $i_am_the_mailbot;
if ('auto' == PVars::getObj('db')->dbupdate && !(isset($_SYSHCVOL['NODBAUTOUPDATE']) ? $_SYSHCVOL['NODBAUTOUPDATE'] : true) && !(isset($i_am_the_mailbot) ? $i_am_the_mailbot : false)) {
DBUpdateCheck();
}
// Adding a time limit
set_time_limit(15);
// No page must go longer than this number of seconds
// mysql_query("SET CHARACTER SET 'utf8'", $db );
}
示例2: formatFeedItem
/**
* TODO: source url?
*/
protected function formatFeedItem($title, $message, $pubdate, $link, $author)
{
$phpdate = strtotime($pubdate);
$pubdate = date("D, d M Y H:i:s", $phpdate) . " GMT";
$rsstitle = $this->ww->RssTitle($title, $author);
return "\r\n <item>\r\n <title>" . strip_tags($rsstitle) . "</title>\r\n <description>" . strip_tags($message) . "</description>\r\n <source url=\"http://www.bewelcome.org/\">BeWelcome</source>\r\n <pubDate>" . $pubdate . "</pubDate>\r\n <category>BeWelcome</category>\r\n <guid>" . PVars::getObj('env')->baseuri . $link . "</guid>\r\n <link>" . PVars::getObj('env')->baseuri . $link . "</link>\r\n <author>" . $author . "</author>\r\n </item>\r\n ";
}
示例3: column_col3
protected function column_col3()
{
$words = $this->words;
$cnt_pictures = $this->cnt_pictures;
$statement = $this->statement;
$gallery = $this->gallery;
$mem_redirect = $this->layoutkit->formkit->getMemFromRedirect();
$page_url = PVars::getObj('env')->baseuri . implode('/', PRequest::get()->request);
$formkit = $this->layoutkit->formkit;
$callback_tag = $formkit->setPostCallback('GalleryController', 'updateGalleryCallback');
if ($this->myself && $this->upload) {
// Display the upload form
require SCRIPT_BASE . 'build/gallery/templates/uploadform.php';
}
$this->thumbsize = 1;
echo '<form method="POST" action="">' . $callback_tag;
require SCRIPT_BASE . 'build/gallery/templates/imagefixedcolumns.list.php';
if ($this->myself) {
echo <<<HTML
<p class="small">
<input type="checkbox" name="selectAllRadio" class="checker" onclick="common.selectAll(this);">
{$words->get('SelectAll')}
|
{$words->get('GalleryWithSelected')}:
<input name="gallery" type="hidden" value="{$gallery->id}">
<input name="removeOnly" type="hidden" value="1">
<input type="submit" name="button" value="{$words->getBuffered('GalleryRemoveImagesFromPhotoset')}" class="button" style="cursor:pointer"/>
<a href="gallery/show/sets/{$this->gallery->id}/upload" class="button" /><img src="images/icons/picture_add.png">{$words->get('GalleryUploadPhotos')}</a>
</p>
</form>
HTML;
}
}
示例4: column_col3
protected function column_col3()
{
$page_url = PVars::getObj('env')->baseuri . implode('/', PRequest::get()->request);
echo '
<h3>Hellouniverse Calculator!</h3>
';
if (!($mem_redirect = $this->layoutkit->formkit->getMemFromRedirect())) {
// nothing, this is a fresh calculator page
} else {
// result from calculation
echo '
<p>
Result from last calculation: ' . $mem_redirect->x . ' + ' . $mem_redirect->y . ' = ' . $mem_redirect->z . '
</p>
';
}
echo '
<p>
<form method="POST" action="' . $page_url . '">
' . $this->layoutkit->formkit->setPostCallback('HellouniverseController', 'calculatorCallback') . '
<input name="x"/> + <input name="y"/> = ?
<input type="submit" value="send"/>
</form>
</p>
';
}
示例5: column_col3
protected function column_col3()
{
$trip = $this->trip;
$trip_data = $this->trip_data;
$words = new MOD_words();
$layoutbits = new MOD_layoutbits();
$member = $this->model->getLoggedInMember();
$google_conf = PVars::getObj('config_google');
$Model = new Blog();
$callback = $this->getCallbackOutput('BlogController', 'createProcess');
// get the saved post vars
// todo: grab from page model
$vars = array();
$request = PRequest::get()->request;
$errors = array();
$lang = array();
//$tripIt = $Model->getTripFromUserIt($member->id);
//$defaultVis = A PP_User::getSetting($User->getId(), 'APP_blog_defaultVis');
// defaults to public then
$defaultVis = false;
if (!$member) {
$isOwnTrip = false;
} else {
$isOwnTrip = $trip->IdMember == $member->id;
}
require 'templates/singletrip_details.php';
require 'templates/singletrip.php';
$shoutsCtrl = new ShoutsController();
$shoutsCtrl->shoutsList('trip', $trip->trip_id);
}
示例6: body
/**
* content of the middle column - this is the most important part
*/
protected function body()
{
// get the translation module
$words = $this->getWords();
$page_url = PVars::getObj('env')->baseuri . implode('/', PRequest::get()->request);
$request = PRequest::get()->request;
$callbacktag = $this->layoutkit->formkit->setPostCallback('GeoController', 'SelectorCallback');
if (!($mem_redirect = $this->layoutkit->formkit->getMemFromRedirect())) {
$locations_print = '';
} elseif ($mem_redirect->location) {
$Geo = new GeoController();
$locations_print = $Geo->GeoSearch($mem_redirect->location, 40, false, $callbacktag);
} else {
$Geo = new GeoController();
$locations_print = $Geo->GeoSearch(' ', 40, false, $callbacktag);
}
// Just for testing:
// if (isset($_SESSION['GeoVars'])) var_dump($_SESSION['GeoVars']);
// if (isset($_SESSION['GeoVars']['geonamename'])) var_dump($_SESSION['GeoVars']['geonamename']);
// if (isset($request[2]) && $request[2] == 'save' && $mem_redirect->geolocation) {
// $geolocation = $mem_redirect->geolocation;
// list($geonameid, $geonamename) = preg_split('/[//]/', $geolocation);
// $_SESSION['SignupBWVars']['geonameid'] = $geonameid;
// $_SESSION['SignupBWVars']['geonamename'] = $geonamename;
// print 'GEO SET';
// } else {
// print 'GEO NOT SET';
// }
require 'templates/popup.php';
}
示例7: _getBugreportLink
/**
* used in footer
*/
function _getBugreportLink()
{
$url = PVars::getObj("env")->baseuri . "feedback?";
$url .= "IdCategory=1&";
$url .= "RequestURI=";
$url .= urlencode('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
return $url;
}
示例8: __construct
public function __construct()
{
$db = PVars::getObj('config_rdbms');
if (!$db) {
throw new PException('DB config error!');
}
$dao = PDB::get($db->dsn, $db->user, $db->password);
self::$dao =& $dao;
}
示例9: search_column_col3
public function search_column_col3($sortorder, $queries, $mapstyle, $varsOnLoad, $varsGet, $TabAccomodation)
{
$google_conf = PVars::getObj('config_google');
if ($mapstyle == "mapoff") {
require 'templates/search_nomap.column_col3.php';
} else {
require 'templates/search.column_col3.php';
}
}
示例10: menu_link
function menu_link($link, $to, $msg, $src)
{
/* tiny helper function to make things look nicer -- guaka wished PHP had lambdas! */
echo " <span", factive($link, $to), ">";
if (!empty($src)) {
echo "<img src=\"" . PVars::getObj('env')->baseuri . $src;
}
echo "<a href='" . bwlink($to) . "'>", $msg, "</a></span>\n";
}
示例11: __construct
private function __construct()
{
if (!($configDNSBlock = PVars::getObj('dnsblock') && isset($configDNSBlock->dns))) {
// fallback
$this->_dns_list = array('sbl.spamhaus.org', 'sbl-xbl.spamhaus.org');
} else {
$this->_dns_list = array_map('trim', explode(',', $configDNSBlock->dns));
}
}
示例12: column_col3
protected function column_col3()
{
// get translation module
$layoutkit = $this->layoutkit;
$words = $layoutkit->getWords();
$model = $this->getModel();
$page_url = PVars::getObj('env')->baseuri . implode('/', PRequest::get()->request);
$formkit = $layoutkit->formkit;
$callback_tag = $formkit->setPostCallback('NotifyController', 'NotifyAdminCallback');
$formstart = '<form name="msgform" id="msgform" action="' . $page_url . '" method="post">';
$formstart .= $callback_tag;
$formend = '</form>';
$widget = $layoutkit->createWidget(new NotifyAdminWidget());
$widget->model = $model;
$widget->items_per_page = 20;
$widget->active_page = $this->active_page;
$widget->visible_range = 2;
?>
<div id="notes">
<h3>Administer notes</h3>
<form action="<?php
echo $page_url;
?>
" method="post">
<?php
if ($widget->needsPagination()) {
$widget->showPagination();
}
?>
<?php
$widget->render();
?>
<?php
if ($widget->needsPagination()) {
$widget->showPagination();
}
?>
<input type="hidden" name="action" value="delete"/>
<?php
echo $callback_tag;
?>
<input type="submit" name="button" value="Delete" id="button" />
</form>
<hr />
<form action="<?php
echo $page_url;
?>
" method="post">
<?php
$this->notesActions($callback_tag);
?>
</form>
</div>
<?php
}
示例13: column_col3
public function column_col3()
{
$model = new OnlineModel();
$words = new MOD_words();
PVars::getObj('page')->title = $words->getBuffered('WhoIsOnLinePage');
$TMembers = $model->GetMembers();
$TGuests = $model->GetGuests();
$TotMembers = $model->GetTotMembers();
require 'templates/showonline.php';
}
示例14: setLanguage
/**
* sets the currently used language in the session
*
* @access public
* @return bool
*/
public function setLanguage()
{
if (!$this->isLoaded()) {
return false;
}
$_SESSION['lang'] = $this->ShortCode;
$_SESSION['IdLanguage'] = $this->id;
PVars::register('lang', $_SESSION['lang']);
return true;
}
示例15: ShowOnline
public function ShowOnline()
{
global $_SYSHCVOL;
$words = new MOD_words();
PVars::getObj('page')->title = $words->getBuffered('WhoIsOnLinePage');
$TMembers = $this->_model->GetMembers();
$TGuests = $this->_model->GetGuests();
$TotMembers = $this->_model->GetTotMembers();
require 'templates/showonline.php';
}