当前位置: 首页>>代码示例>>PHP>>正文


PHP db::db_Select方法代码示例

本文整理汇总了PHP中db::db_Select方法的典型用法代码示例。如果您正苦于以下问题:PHP db::db_Select方法的具体用法?PHP db::db_Select怎么用?PHP db::db_Select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在db的用法示例。


在下文中一共展示了db::db_Select方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getPDFPrefs

function getPDFPrefs()
{
    global $sql, $eArrayStorage;
    if (!is_object($sql)) {
        $sql = new db();
    }
    $num_rows = $sql->db_Select("core", "*", "e107_name='pdf' ");
    if ($num_rows == 0) {
        $tmp = getDefaultPDFPrefs();
        $tmp2 = $eArrayStorage->WriteArray($tmp);
        $sql->db_Insert("core", "'pdf', '" . $tmp2 . "' ");
        $sql->db_Select("core", "*", "e107_name='pdf' ");
    }
    $row = $sql->db_Fetch();
    $pdfpref = $eArrayStorage->ReadArray($row['e107_value']);
    return $pdfpref;
}
开发者ID:notzen,项目名称:e107,代码行数:17,代码来源:admin_pdf_config.php

示例2: while

 function roster_show()
 {
     global $sql, $sql2;
     // make the groups
     $groups_q = $sql->db_Select("roster_groups", "*", "roster_group_id!='0' ORDER BY roster_group_order ASC");
     $tables = "";
     while ($row = $sql->db_Fetch(MYSQL_ASSOC)) {
         $tables .= "<table class=\"roster\" width=\"100%\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=\"roster_main\" colspan=\"6\">{$row['roster_group_name']}</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=\"roster_header\" width=\"40%\">" . roster_LAN_ROSTER_NAME . "</td>\n\t\t\t\t\t\t<td class=\"roster_header\" width=\"25%\">" . roster_LAN_ROSTER_UASSIGN . "</td>\n\t\t\t\t\t\t<td class=\"roster_header\" width=\"20%\">" . roster_LAN_ROSTER_SERIAL . "</td>\n\t\t\t\t\t\t<td class=\"roster_header\" width=\"15%\">" . roster_LAN_ROSTER_STATUS . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t";
         $sql3 = new db();
         // get the members in this group
         $members_q = $sql2->db_Select("roster_members", "*", "roster_member_group='" . $row['roster_group_id'] . "' ORDER BY roster_member_ranknum ASC, roster_member_rankdate ASC, roster_member_name ASC");
         while ($row2 = $sql2->db_Fetch(MYSQL_ASSOC)) {
             if ($row2['roster_member_status'] == "Retired") {
                 $status = "<font color=\"#ff0000\">Retired</font>";
             } else {
                 if ($row2['roster_member_status'] == "Reserve") {
                     $status = "<font color=\"#d9c30a\">Reserve</font>";
                 } else {
                     if ($row2['roster_member_status'] == "On Leave") {
                         $status = "<font color=\"#ff9c00\">On Leave</font>";
                     } else {
                         $status = "<font color=\"#48E702\">Active Duty</font>";
                     }
                 }
             }
             $i++;
             $rank = explode(",", $row2['roster_member_rank']);
             $site_name = $rank[2] . "-" . $row2['roster_member_name'];
             $info_q = $sql3->db_Select("user", "*", "user_name='" . $site_name . "'");
             $info_a = $sql3->db_Fetch(MYSQL_ASSOC);
             $pm = "<a href=\"" . e_PLUGIN . "pm/pm.php?send." . $info_a['user_id'] . "\"><img src=\"" . e_THEME . "AA/forum/pm.png\" border=\"0\" /></a>";
             if ($i % 2 == 0) {
                 $tables .= "<tr>\n\t\t\t\t\t\t\t<td class=\"roster_row1\"><a href=\"userinfo.php?m_id={$row1['roster_member_id']}\">{$rank[0]} {$row1['roster_member_name']}</a></td>\n\t\t\t\t\t\t\t<td class=\"roster_row1\">{$row1['roster_member_unit']}</td>\n\t\t\t\t\t\t\t<td class=\"roster_row1\">{$row1['roster_member_serial']}</div></td>\n\t\t\t\t\t\t\t<td class=\"roster_row1\"><div align=\"center\">{$status}</div></td>\n\t\t\t\t\t\t</tr>";
             } else {
                 $tables .= "<tr>\n\t\t\t\t\t\t\t<td class=\"roster_row2\"><a href=\"userinfo.php?m_id={$row2['roster_member_id']}\">{$rank[0]} {$row2['roster_member_name']}</a></td>\n\t\t\t\t\t\t\t<td class=\"roster_row2\">{$row2['roster_member_unit']}</td>\n\t\t\t\t\t\t\t<td class=\"roster_row2\">{$row2['roster_member_serial']}</td>\n\t\t\t\t\t\t\t<td class=\"roster_row2\"><div align=\"center\">{$status}</div></td>\n\t\t\t\t\t\t</tr>";
             }
         }
         $tables .= "</table><br /><br />";
     }
     return $tables;
 }
开发者ID:CAJT-UKCoder,项目名称:e107-Plugins,代码行数:41,代码来源:roster_roster.php

示例3: getPDFPrefs

 function getPDFPrefs()
 {
     global $sql, $eArrayStorage;
     if (!is_object($eArrayStorage)) {
         e107_require_once(e_HANDLER . 'arraystorage_class.php');
         $eArrayStorage = new ArrayData();
     }
     if (!is_object($sql)) {
         $sql = new db();
     }
     $num_rows = $sql->db_Select('core', '*', "e107_name='pdf' ");
     if ($num_rows == 0) {
         $tmp = $this->getDefaultPDFPrefs();
         $tmp2 = $eArrayStorage->WriteArray($tmp);
         $sql->db_Insert('core', "'pdf', '" . $tmp2 . "' ");
         $sql->db_Select('core', '*', "e107_name='pdf' ");
     }
     $row = $sql->db_Fetch();
     $pdfPref = $eArrayStorage->ReadArray($row['e107_value']);
     return $pdfPref;
 }
开发者ID:notzen,项目名称:e107,代码行数:21,代码来源:e107pdf.php

示例4:

 $item_name = $row["item_name"];
 $item_description = strip_tags($tp->toHTML($row["item_description"], true));
 $item_image = $row["item_image"];
 $item_active_status = $row["item_active_status"];
 $item_price = $row["item_price"];
 $discount_id = $row["discount_id"];
 $discount_class = $row["discount_class"];
 $discount_valid_from = $row["discount_valid_from"];
 $discount_valid_till = $row["discount_valid_till"];
 $discount_code = $row["discount_code"];
 $discount_flag = $row["discount_flag"];
 $discount_percentage = $row["discount_percentage"];
 $discount_price = $row["discount_price"];
 $property_prices = $row["property_prices"];
 // Retrieve shop settings
 $sql->db_Select(DB_TABLE_SHOP_PREFERENCES, "*", "store_id=1");
 if ($row = $sql->db_Fetch()) {
     $store_image_path = $row['store_image_path'];
     $set_currency_behind = $row['set_currency_behind'];
 }
 // Check admin setting to set currency behind amount
 // 0 = currency before amount (default), 1 = currency behind amount
 if ($set_currency_behind == '') {
     $set_currency_behind = 0;
 }
 // Define position of currency character
 $sql->db_Select(DB_TABLE_SHOP_CURRENCY, "*", "currency_active=2");
 if ($row = $sql->db_Fetch()) {
     $unicode_character = $row['unicode_character'];
     $paypal_currency_code = $row['paypal_currency_code'];
 }
开发者ID:nlstart,项目名称:easyshop,代码行数:31,代码来源:easyshop_specials_menu.php

示例5: urlencode

require_once 'includes/config.php';
// Get language file (assume that the English language file is always present)
include_lan(e_PLUGIN . 'easyshop/languages/' . e_LANGUAGE . '.php');
// Read the post from PayPal system and add 'cmd'
$req = 'cmd=_notify-validate';
require_once 'includes/ipn_functions.php';
require_once 'easyshop_class.php';
foreach ($_POST as $key => $value) {
    $value = urlencode(stripslashes($value));
    $req .= "&{$key}={$value}";
}
$log = fopen("ipn.log", "a");
fwrite($log, "\n\nipn - " . gmstrftime("%b %d %Y %H:%M:%S", time()));
// Retrieve the sandbox setting from the shop preferences
$sql = new db();
$sql->db_Select(DB_TABLE_SHOP_PREFERENCES, "*", "store_id=1");
if ($row = $sql->db_Fetch()) {
    $sandbox = $row['sandbox'];
    $paypal_primary_email = $row['paypal_primary_email'];
}
if ($sandbox == 2) {
    $actionDomain = "www.sandbox.paypal.com";
} else {
    $actionDomain = "www.paypal.com";
}
// Post back to PayPal system to validate
$header = "POST /cgi-bin/webscr HTTP/1.0\r\n";
$header .= "Host: " . $actionDomain . "\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
$fp = fsockopen('ssl://' . $actionDomain, "443", $errno, $errstr, 30);
开发者ID:nlstart,项目名称:easyshop,代码行数:31,代码来源:validate.php

示例6: db

 function convert_row($name, $query, $startorder)
 {
     global $sql, $tp, $plugintable;
     $plugintable = "pcontent";
     // ##### STAGE 8 : INSERT ROW -------------------------------------------------------------
     if (!is_object($sql)) {
         $sql = new db();
     }
     if (!($thiscount = $sql->db_Select("content", "*", " " . $query . " ORDER BY content_id "))) {
         $check_present = false;
     } else {
         $count = $startorder;
         $check_present = true;
         while ($row = $sql->db_Fetch()) {
             $oldcontentid = $row['content_id'];
             //select main parent id
             if (!is_object($sql2)) {
                 $sql2 = new db();
             }
             $sql2->db_Select($plugintable, "content_id", "content_heading = '" . $name . "' AND content_parent = '0' ");
             list($main_id) = $sql2->db_Fetch();
             //item is in main cat
             if ($row['content_parent'] == "0") {
                 $newcontent_parent = $main_id;
                 //item is in sub cat
             } else {
                 //select old review cat heading
                 if (!is_object($sql3)) {
                     $sql3 = new db();
                 }
                 if (!$sql3->db_Select("content", "content_id, content_heading", "content_id = '" . $row['content_parent'] . "' ")) {
                     $bug_oldcat[] = $row['content_id'] . " " . $row['content_heading'];
                     $newcontent_parent = $main_id;
                 } else {
                     list($old_cat_id, $old_cat_heading) = $sql3->db_Fetch();
                     //select new cat id from the cat with the old_cat_heading
                     if (!is_object($sql4)) {
                         $sql4 = new db();
                     }
                     if (!$sql4->db_Select($plugintable, "content_id", "content_heading = '" . $old_cat_heading . "' AND content_parent = '0." . $main_id . "' ")) {
                         $bug_newcat[] = $row['content_id'] . " " . $row['content_heading'];
                         $newcontent_parent = $main_id;
                     } else {
                         list($new_cat_id) = $sql4->db_Fetch();
                         $newcontent_parent = $new_cat_id;
                     }
                 }
             }
             if (strstr($row['content_content'], "{EMAILPRINT}")) {
                 $row['content_content'] = str_replace("{EMAILPRINT}", "", $row['content_content']);
             }
             $newcontent_heading = $tp->toDB($row['content_heading']);
             $newcontent_subheading = $row['content_subheading'] ? $tp->toDB($row['content_subheading']) : "";
             //summary can contain link to image in e107_images/link_icons/".$summary." THIS STILL NEEDS TO BE CHECKED
             $newcontent_summary = $row['content_summary'] ? $tp->toDB($row['content_summary']) : "";
             $newcontent_text = $tp->toDB($row['content_content']);
             //$newcontent_author	= (is_numeric($row['content_author']) ? $row['content_author'] : "0^".$row['content_author']);
             $newcontent_author = $row['content_author'];
             $newcontent_icon = "";
             $newcontent_attach = "";
             $newcontent_images = "";
             $newcontent_comment = $row['content_comment'];
             $newcontent_rate = "0";
             $newcontent_pe = $row['content_pe_icon'];
             $newcontent_refer = $row['content_type'] == "15" || $row['content_type'] == "16" ? "sa" : "";
             $newcontent_starttime = $row['content_datestamp'];
             $newcontent_endtime = "0";
             $newcontent_class = $row['content_class'];
             $newcontent_pref = "";
             $newcontent_score = $row['content_review_score'] && $row['content_review_score'] != "none" ? $row['content_review_score'] : "0";
             $newcontent_meta = "";
             $newcontent_layout = "";
             if (!is_object($sql5)) {
                 $sql5 = new db();
             }
             $sql5->db_Insert($plugintable, "'" . $row['content_id'] . "', '" . $newcontent_heading . "', '" . $newcontent_subheading . "', '" . $newcontent_summary . "', '" . $newcontent_text . "', '" . $newcontent_author . "', '" . $newcontent_icon . "', '" . $newcontent_attach . "', '" . $newcontent_images . "', '" . $newcontent_parent . "', '" . $newcontent_comment . "', '" . $newcontent_rate . "', '" . $newcontent_pe . "', '" . $newcontent_refer . "', '" . $newcontent_starttime . "', '" . $newcontent_endtime . "', '" . $newcontent_class . "', '" . $newcontent_pref . "', '1." . $count . "', '" . $newcontent_score . "', '" . $newcontent_meta . "', '" . $newcontent_layout . "' ");
             if (!is_object($sql6)) {
                 $sql6 = new db();
             }
             if (!$sql6->db_Select($plugintable, "content_id, content_heading", "content_heading = '" . $newcontent_heading . "' ")) {
                 $bug_insert[] = $row['content_id'] . " " . $row['content_heading'];
             } else {
                 $valid_insert[] = $row['content_id'] . " " . $row['content_heading'];
                 $count = $count + 1;
             }
         }
     }
     $convert_row = array($check_present, $count, $valid_insert, $bug_insert, $bug_oldcat, $bug_newcat);
     return $convert_row;
 }
开发者ID:Jimmi08,项目名称:content,代码行数:90,代码来源:content_convert_class.php

示例7: array

$feed['name'] = 'Featurebox';
$feed['url'] = 'featurebox';
//the identifier for the rss feed url
$feed['topic_id'] = '';
//the topic_id, empty on default (to select a certain category)
$feed['path'] = 'featurebox';
//this is the plugin path location
$feed['text'] = 'this is the rss feed for the featurebox entries';
$feed['class'] = '0';
$feed['limit'] = '9';
$eplug_rss_feed[] = $feed;
//##### ------------------------------------------------------------------------------------
//##### create rss data, return as array $eplug_rss_data -----------------------------------
$rss = array();
$sqlrss = new db();
if ($items = $sqlrss->db_Select('featurebox', "*", "fb_class = 0 DESC LIMIT 0," . $this->limit)) {
    $i = 0;
    while ($rowrss = $sqlrss->db_Fetch()) {
        $rss[$i]['author'] = '';
        $rss[$i]['author_email'] = '';
        $rss[$i]['link'] = '';
        $rss[$i]['linkid'] = '';
        $rss[$i]['title'] = $rowrss['fb_title'];
        $rss[$i]['description'] = $rowrss['fb_text'];
        $rss[$i]['category_name'] = '';
        $rss[$i]['category_link'] = '';
        $rss[$i]['datestamp'] = '';
        $rss[$i]['enc_url'] = '';
        $rss[$i]['enc_leng'] = '';
        $rss[$i]['enc_type'] = '';
        $i++;
开发者ID:notzen,项目名称:e107,代码行数:31,代码来源:e_rss.php

示例8: License

|
|	For the e107 website system visit http://e107.org
|
|	Released under the terms and conditions of the
|	GNU General Public License (http://gnu.org).
+------------------------------------------------------------------------------+
*/
// class2.php is the heart of e107, always include it first to give access to e107 constants and variables
require_once '../../class2.php';
// Get language file (assume that the English language file is always present)
include_lan(e_PLUGIN . 'easyshop/languages/' . e_LANGUAGE . '.php');
// use HEADERF for USER PAGES and e_ADMIN."auth.php" for admin pages
require_once HEADERF;
require_once 'includes/config.php';
$sql = new db();
$sql->db_Select(DB_TABLE_SHOP_PREFERENCES);
while ($row = $sql->db_Fetch()) {
    $store_name = $row['store_name'];
    $store_address_1 = $row['store_address_1'];
    $store_address_2 = $row['store_address_2'];
    $store_city = $row['store_city'];
    $store_state = $row['store_state'];
    $store_zip = $row['store_zip'];
    $store_country = $row['store_country'];
    $support_email = $row['support_email'];
    $store_welcome_message = $row['store_welcome_message'];
    $store_info = $row['store_info'];
    $thank_you_page_title = $row['thank_you_page_title'];
    $thank_you_page_text = $row['thank_you_page_text'];
}
// Reset the shopping basket arrays when thank you page is called
开发者ID:laiello,项目名称:e107-easyshop,代码行数:31,代码来源:thank_you.php

示例9: generateUserLogin

 /**
  *	Generates a random user login name according to some pattern.
  *	Checked for uniqueness.
  *
  *	@param string $pattern - defines the format of the username
  *	@param int $seed - may be used with the random pattern generator
  *
  *	@return string a user login name, guaranteed unique in the database.
  */
 public function generateUserLogin($pattern, $seed = '')
 {
     $ul_sql = new db();
     if (strlen($pattern) < 6) {
         $pattern = '##....';
     }
     do {
         $newname = $this->generateRandomString($pattern, $seed);
     } while ($ul_sql->db_Select('user', 'user_id', "`user_loginname`='{$newname}'"));
     return $newname;
 }
开发者ID:notzen,项目名称:e107,代码行数:20,代码来源:user_handler.php

示例10: header

    require_once "../../class2.php";
}
require_once HEADERF;
require_once e_PLUGIN . "e107dkp/includes/config.php";
global $pref;
$item = $_GET['i'];
$userID = USERID;
if (!$_GET['i']) {
    header("Location: /index.php");
}
if ($pref['wcm_version']) {
    require_once e_PLUGIN . "wcm/includes/config.php";
    $charID = WCMgetCharInfoByName($character, "char_id");
    if (WCMCheckChar($userID, $charID) || WCMCheckCharAdmin()) {
        $sql99 = new db();
        $sql99->db_Select(DKPDB_TABLE_ITEMS, "item_name", "item_id='" . $item . "'");
        while ($row99 = $sql99->db_Fetch()) {
            $item_name = $row99["item_name"];
        }
        if (empty($item_name)) {
            $text .= "No item data could be located with the name provided: {$item_name}<br>";
        } else {
            $text .= '
<table width="100%" border="0" cellspacing="1" cellpadding="2">
  <tr class="rowhead">
    <th align="center" colspan="4"><u>Purchase History for ' . $item_name . '</u></th>
  </tr>
  
  <tr>
    <th align="left" width="90" nowrap="nowrap">Date</th>
    <th align="left" width="35%">Buyer</th>
开发者ID:slijm,项目名称:e107dkp,代码行数:31,代码来源:view_item.php

示例11: forumUpdateLastpost

 function forumUpdateLastpost($type, $id, $updateThreads = false)
 {
     global $sql, $tp;
     $sql2 = new db();
     if ($type == 'thread') {
         $id = (int) $id;
         $lpInfo = $this->threadGetLastpost($id);
         $tmp = array();
         if ($lpInfo['user_name']) {
             $tmp['thread_lastuser'] = $lpInfo['post_user'];
             $tmp['thread_lastuser_anon'] = '_NULL_';
         } else {
             $tmp['thread_lastuser'] = 0;
             $tmp['thread_lastuser_anon'] = $lpInfo['post_user_anon'] ? $lpInfo['post_user_anon'] : 'Anonymous';
         }
         $tmp['thread_lastpost'] = $lpInfo['post_datestamp'];
         $info = array();
         $info['data'] = $tmp;
         //			$info['_FIELD_TYPES'] = $this->fieldTypes['forum_thread'];
         $info['WHERE'] = 'thread_id = ' . $id;
         $sql->db_Update('forum_thread', $info);
         return $lpInfo;
     }
     if ($type == 'forum') {
         if ($id == 'all') {
             if ($sql->db_Select('forum', 'forum_id', 'forum_parent != 0')) {
                 while ($row = $sql->db_Fetch(MYSQL_ASSOC)) {
                     $parentList[] = $row['forum_id'];
                 }
                 foreach ($parentList as $id) {
                     set_time_limit(60);
                     $this->forumUpdateLastpost('forum', $id, $updateThreads);
                 }
             }
         } else {
             $id = (int) $id;
             $lp_info = '';
             $lp_user = 'NULL';
             if ($updateThreads == true) {
                 if ($sql2->db_Select('forum_t', 'thread_id', "thread_forum_id = {$id} AND thread_parent = 0")) {
                     while ($row = $sql2->db_Fetch(MYSQL_ASSOC)) {
                         set_time_limit(60);
                         $this->forumUpdateLastpost('thread', $row['thread_id']);
                     }
                 }
             }
             if ($sql->db_Select('forum_thread', 'thread_id, thread_lastuser, thread_lastuser_anon, thread_datestamp', 'thread_forum_id=' . $id . ' ORDER BY thread_datestamp DESC LIMIT 1')) {
                 $row = $sql->db_Fetch(MYSQL_ASSOC);
                 $lp_info = $row['thread_datestamp'] . '.' . $row['thread_id'];
                 $lp_user = $row['thread_lastuser'];
             }
             if ($row['thread_lastuser_anon']) {
                 $sql->db_Update('forum', "forum_lastpost_user = 0, forum_lastpost_anon = '{$row['thread_lastuser_anon']}', forum_lastpost_info = '{$lp_info}' WHERE forum_id=" . $id);
             } else {
                 $sql->db_Update('forum', "forum_lastpost_user = {$lp_user}, forum_lastpost_user_anon = NULL, forum_lastpost_info = '{$lp_info}' WHERE forum_id=" . $id);
             }
         }
     }
 }
开发者ID:notzen,项目名称:e107,代码行数:59,代码来源:forum_class.php

示例12: CreateParentMenu

    function CreateParentMenu($parentid)
    {
        global $plugintable, $plugindir, $tp, $datequery;
        if (!is_object($sqlcreatemenu)) {
            $sqlcreatemenu = new db();
        }
        if (!$sqlcreatemenu->db_Select($plugintable, "*", "content_id='" . intval($parentid) . "'  ")) {
            return FALSE;
        } else {
            $row = $sqlcreatemenu->db_Fetch();
        }
        $content_path_menu = $plugindir . "menus/";
        if (!is_writable($content_path_menu)) {
            echo "<b>" . CONTENT_ADMIN_ITEM_LAN_22 . " " . $content_path_menu . " " . CONTENT_ADMIN_ITEM_LAN_23 . "</b><br />";
            return FALSE;
        }
        $menufile = "content_" . $row['content_heading'];
        $menuname = $row['content_heading'];
        $data = chr(60) . "?php\n" . chr(47) . "*\n+---------------------------------------------------------------+\n|        e107 website system\n|        " . e_PLUGIN . "content/menus/" . $menufile . "_menu.php\n|\n|        (C)Steve Dunstan 2001-2002\n|        http://e107.org\n|        jalist@e107.org\n|\n|        Released under the terms and conditions of the\n|        GNU General Public License (http://gnu.org).\n+---------------------------------------------------------------+\n\nThis file has been generated by " . e_PLUGIN . "content/handlers/content_class.php.\n\n*" . chr(47) . "\n\n";
        $data .= "\n";
        $data .= "unset(\$text);\n";
        $data .= "\$text = \"\";\n";
        $data .= "\$menutypeid\t\t= \"{$parentid}\";\n";
        $data .= "\$menuname\t\t= \"{$menuname}\";\n";
        $data .= "\n";
        $data .= "\$plugindir\t\t= e_PLUGIN.'content/';\n";
        $data .= "\$plugintable\t= \"pcontent\";\t\t//name of the table used in this plugin (never remove this, as it's being used throughout the plugin !!)\n";
        $data .= "\$datequery\t\t= \" AND content_datestamp < \".time().\" AND (content_enddate=0 || content_enddate>\".time().\") \";\n";
        $data .= "\n";
        $data .= "require_once(e_PLUGIN.'content/handlers/content_class.php');\n";
        $data .= "\$aa = new content;\n";
        $data .= "require_once(e_HANDLER.'form_handler.php');\n";
        $data .= "\$rs = new form;\n";
        $data .= "\$gen = new convert;\n";
        $data .= "global \$tp;\n";
        $data .= "\n";
        $data .= "include_lan(e_PLUGIN.'content/languages/'.e_LANGUAGE.'/lan_content.php');\n";
        $data .= '
					$bullet = \'\';
					if(defined(\'BULLET\'))
					{
						$bullet = \'<img src="\'.THEME.\'images/\'.BULLET.\'" alt="" style="vertical-align: middle;" />\';
					}
					elseif(file_exists(THEME.\'images/bullet2.gif\'))
					{
						$bullet = \'<img src="\'.THEME.\'images/bullet2.gif" alt="" style="vertical-align: middle;" />\';
					}
			';
        $data .= "\$content_pref\t\t\t\t\t= \$aa -> getContentPref(\$menutypeid);\n";
        $data .= "\$content_icon_path\t\t\t\t= \$tp -> replaceConstants(\$content_pref[\"content_icon_path\"]);\n";
        $data .= "\$content_cat_icon_path_small\t= \$tp -> replaceConstants(\$content_pref[\"content_cat_icon_path_small\"]);\n";
        $data .= "\n";
        $data .= "\t\$break = FALSE;\n";
        $data .= "//##### SEARCH SELECT ORDER --------------------------------------------------\n";
        $data .= "//show search box\n";
        $data .= "if(\$content_pref[\"content_menu_search\"]){\n";
        $data .= "\t\$text .= \$aa -> showOptionsSearch(\"menu\", \$menutypeid);\n";
        $data .= "\t\$break = TRUE;\n";
        $data .= "}\n";
        $data .= "//show select box (with either links to other content pages, to categories, to both, or don't show at all)\n";
        $data .= "if( (\$content_pref[\"content_menu_links\"] && \$content_pref[\"content_menu_links_dropdown\"]) || (\$content_pref[\"content_menu_cat\"] && \$content_pref[\"content_menu_cat_dropdown\"]) ){\n";
        $data .= "\t\$text .= \$aa -> showOptionsSelect(\"menu\", \$menutypeid);\n";
        $data .= "\t\$break = TRUE;\n";
        $data .= "}\n";
        $data .= "//show order box\n";
        $data .= "if(\$content_pref[\"content_menu_sort\"]){\n";
        $data .= "\t\$text .= \$aa -> showOptionsOrder(\"menu\", \$menutypeid);\n";
        $data .= "\t\$break = TRUE;\n";
        $data .= "}\n";
        $data .= "\n";
        $data .= "//show links list if chosen so\n";
        $data .= "if(\$content_pref[\"content_menu_links\"] && !\$content_pref[\"content_menu_links_dropdown\"]){\n";
        $data .= "\tif(\$break === TRUE){\n";
        $data .= "\t   \$text .= \"<br />\";\n";
        $data .= "\t}\n";
        $data .= "\t\$text .= (\$content_pref[\"content_menu_links_caption\"] != \"\" ? \$content_pref[\"content_menu_links_caption\"] : CONTENT_MENU_LAN_4).\"<br />\";\n";
        $data .= "\n";
        $data .= "\t//define icon\n";
        $data .= "\tif(\$content_pref[\"content_menu_links_icon\"] == \"0\"){ \$linksicon = \"\";\n";
        $data .= "\t}elseif(\$content_pref[\"content_menu_links_icon\"] == \"1\"){ \$linksicon = \$bullet;\n";
        $data .= "\t}elseif(\$content_pref[\"content_menu_links_icon\"] == \"2\"){ \$linksicon = \"&middot\";\n";
        $data .= "\t}elseif(\$content_pref[\"content_menu_links_icon\"] == \"3\"){ \$linksicon = \"&ordm;\";\n";
        $data .= "\t}elseif(\$content_pref[\"content_menu_links_icon\"] == \"4\"){ \$linksicon = \"&raquo;\";\n";
        $data .= "\t}\n";
        $data .= "\n";
        $data .= "\$urlrow[\"url_content_id\"]\t\t= \$menutypeid;\n";
        $data .= "\tif(\$content_pref[\"content_menu_viewallcat\"]){\n";
        $data .= "\t\t\$text .= \$linksicon.\" <a href='\".e107::url(\"content\", \"catlist\", \$urlrow, \"full\").\"'>\".CONTENT_LAN_6.\"</a><br />\";\n";
        $data .= "\t}\n";
        $data .= "\tif(\$content_pref[\"content_menu_viewallauthor\"]){\n";
        $data .= "\t\t\$text .= \$linksicon.\" <a href='\".e107::url(\"content\", \"authors\", \$urlrow, \"full\").\"'>\".CONTENT_LAN_7.\"</a><br />\";\n";
        $data .= "\t}\n";
        $data .= "\tif(\$content_pref[\"content_menu_viewallitems\"]){\n";
        $data .= "\t\t\$text .= \$linksicon.\" <a href='\".e107::url(\"content\", \"archive\", \$urlrow, \"full\").\"'>\".CONTENT_LAN_83.\"</a><br />\";\n";
        $data .= "\t}\n";
        $data .= "\tif(\$content_pref[\"content_menu_viewtoprated\"]){\n";
        $data .= "\t\t\$text .= \$linksicon.\" <a href='\".e107::url(\"content\", \"toprated\", \$urlrow, \"full\").\"'>\".CONTENT_LAN_8.\"</a><br />\";\n";
        $data .= "\t}\n";
        $data .= "\tif(\$content_pref[\"content_menu_viewtopscore\"]){\n";
        $data .= "\t\t\$text .= \$linksicon.\" <a href='\".e107::url(\"content\", \"topscore\", \$urlrow, \"full\").\"'>\".CONTENT_LAN_12.\"</a><br />\";\n";
//.........这里部分代码省略.........
开发者ID:Jimmi08,项目名称:content,代码行数:101,代码来源:content_class.php

示例13: explode

            $key = array_search(trim($_POST[$prod_prop]), ${"prop" . $n . "_array"});
            // Create price array
            ${"price" . $n . "_array"} = explode(",", $_POST[$prop_prices]);
            // Adjust the price with the corresponding price
            $_POST['item_price'] = (double) $_POST['item_price'] + ${"price" . $n . "_array"}[$key];
            // Adjust the item id
            $_POST['item_id'] = intval($_POST['item_id']) . trim($_POST[$prod_prop]);
            // Adjust item name
            $_POST['item_name'] = $_POST['item_name'] . " " . trim($_POST[$prod_prop]);
        }
    }
}
// Check on incoming discount before filling the basket
// if ($_POST['discount_code'] <> "" or !isset($_POST['discount_code'])) { // Only activate when discount code is filled in //Bugfix #75
$sql = new db();
$sql->db_Select(DB_TABLE_SHOP_DISCOUNT, "*", "discount_id=" . intval($_POST['discount_id']));
// Security fix with intval
if ($row = $sql->db_Fetch()) {
    $discount_id = $row['discount_id'];
    // $discount_name = $row['discount_name'];
    // $discount_class = $row['discount_class'];
    $discount_flag = $row['discount_flag'];
    $discount_price = number_format($row['discount_price'], 2, '.', '');
    $discount_percentage = number_format($row['discount_percentage'], 2, '.', '');
    $discount_valid_from = $row['discount_valid_from'];
    $discount_valid_till = $row['discount_valid_till'];
    $discount_code = $row['discount_code'];
    //} Removed due to Bugfix#75
    $no_discount_code = false;
    if (!isset($_POST['discount_code']) && $discount_code == "") {
        // Set variable to true when no discount code is available: Bugfix #75
开发者ID:nlstart,项目名称:easyshop,代码行数:31,代码来源:easyshop_basket.php

示例14: db

 function view_subscribers($p_id)
 {
     $ns = e107::getRender();
     $mes = e107::getMessage();
     $frm = e107::getForm();
     $nl_sql = new db();
     $_nl_sanatized = '';
     if (!$nl_sql->db_Select('newsletter', '*', 'newsletter_id=' . $p_id)) {
         $mes->addError(NLLAN_56);
         $vs_text .= "<div class='buttons-bar center'>\n\t\t\t\t\t\t\t<input class='btn btn-default button' type=button value='" . LAN_BACK . "' onClick=\"window.location='" . e_SELF . "'\">\n\t\t\t\t\t\t</div>";
         $ns->tablerender(NLLAN_65 . ' ' . $p_id, $mes->render() . $vs_text);
         return;
     } else {
         $vs_text .= "\n\t\t\t<form action='" . e_SELF . "' id='newsletterform' method='post'>\n\t\t\t<table class='table adminlist'>\n\t\t\t<colgroup>\n\t\t\t\t<col style='width: 5%;  text-align: center;' />\n\t\t\t\t<col style='width: 35%;' />\n\t\t\t\t<col style='width: 45%;' />\n\t\t\t\t<col style='width: 15%; text-align: center;' />\n\t\t\t</colgroup>\n\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . LAN_ID . "</td>\n\t\t\t\t\t<td>" . LAN_NAME . "</td>\n\t\t\t\t\t<td>" . LAN_EMAIL . "</td>\n\t\t\t\t\t<td>" . LAN_OPTIONS . "</td>\n\t\t\t\t</tr>";
         if ($nl_row = $nl_sql->db_Fetch()) {
             $subscribers_list = explode(chr(1), trim($nl_row['newsletter_subscribers']));
             sort($subscriber_list);
             $subscribers_total_count = count($subscribers_list) - 1;
             // Get a null entry as well
         }
         if ($subscribers_total_count < 1) {
             header("location:" . e_SELF);
             exit;
         }
         // Loop through each user in the array subscribers_list & sanatize
         $_last_subscriber = '';
         foreach ($subscribers_list as $val) {
             $val = trim($val);
             if ($val) {
                 if ($val != $_last_subscriber) {
                     $nl_sql->db_Select("user", "*", "user_id=" . $val);
                     if ($nl_row = $nl_sql->db_Fetch()) {
                         $vs_text .= "\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>" . $val . "</td>\n\t\t\t\t\t\t\t\t<td><a href='" . e_BASE . "user.php?id.{$val}'>" . $nl_row['user_name'] . "</a></td>\n\t\t\t\t\t\t\t\t<td>" . $nl_row['user_email'] . "</td>\n\t\t\t\t\t\t\t\t<td><a href='" . e_SELF . "?remove.{$p_id}.{$val}'>" . ADMIN_DELETE_ICON . "</a>" . ($nl_row['user_ban'] > 0 ? NLLAN_62 : "") . "</td>\n\t\t\t\t\t\t\t</tr>";
                         $_last_subscriber = $val;
                     }
                 } else {
                     // Duplicate user id found in the subscribers_list array!
                     newsletter::remove_subscribers($p_id, $val);
                     // removes all entries for this user id
                     $newsletterArray[$p_id]['newsletter_subscribers'] = chr(1) . $val;
                     // keep this single value in the list
                     $nl_sql->db_Update("newsletter", "newsletter_subscribers='" . $newsletterArray[$p_id]['newsletter_subscribers'] . "' WHERE newsletter_id='" . intval($p_id) . "'");
                     $subscribers_total_count--;
                     $_nl_sanatized = 1;
                 }
             }
         }
     }
     $vs_text .= "\n\t\t<tr>\n\t\t\t<td colspan='4'>" . NLLAN_63 . ": " . $subscribers_total_count . "</td>\n\t\t</tr>\n\t\t </table>\n\t\t\t <div class='buttons-bar center'>\n\t\t\t \t" . $frm->admin_button('submit', LAN_BACK, 'submit') . "\n\t\t\t </div>\t\t\t\n\t\t </form>\n\t\t  ";
     if ($_nl_sanatized == 1) {
         $mes->addInfo(NLLAN_66);
     }
     $ns->tablerender(NLLAN_65 . ' ' . $p_id, $mes->render() . $vs_text);
 }
开发者ID:gitter-badger,项目名称:e107,代码行数:54,代码来源:admin_config.php

示例15: flood

 function flood($table, $orderfield)
 {
     /*
     # Test for possible flood
     #
     # - parameter #1                string $table, table being affected
     # - parameter #2                string $orderfield, date entry in respective table
     # - return                                boolean
     # - scope                                        public
     */
     $sql = new db();
     if (FLOODPROTECT == true) {
         $sql->db_Select($table, '*', 'ORDER BY ' . $orderfield . ' DESC LIMIT 1', 'no_where');
         $row = $sql->db_Fetch();
         return $row[$orderfield] > time() - FLOODTIMEOUT ? false : true;
     } else {
         return TRUE;
     }
 }
开发者ID:gitye,项目名称:e107,代码行数:19,代码来源:class2.php


注:本文中的db::db_Select方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。