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


PHP db::db_Fetch方法代码示例

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


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

示例1: DKPraidCount

function DKPraidCount($character_name)
{
    $sql99 = new db();
    $count30_total = $sql99->db_Count(DKPDB_TABLE_RAIDS, "(*)", "WHERE (raid_date BETWEEN '" . mktime(0, 0, 0, date('m'), date('d') - 30, date('Y')) . "' AND '" . time() . "')");
    $count60_total = $sql99->db_Count(DKPDB_TABLE_RAIDS, "(*)", "WHERE (raid_date BETWEEN '" . mktime(0, 0, 0, date('m'), date('d') - 60, date('Y')) . "' AND '" . time() . "')");
    $count90_total = $sql99->db_Count(DKPDB_TABLE_RAIDS, "(*)", "WHERE (raid_date BETWEEN '" . mktime(0, 0, 0, date('m'), date('d') - 90, date('Y')) . "' AND '" . time() . "')");
    $sql99->db_Select_gen("SELECT count(*) FROM " . MPREFIX . DKPDB_TABLE_RAIDS . " r, " . MPREFIX . DKPDB_TABLE_RAID_A . " ra WHERE (ra.raid_id = r.raid_id) AND (ra.member_name='" . $character_name . "') AND (r.raid_date BETWEEN " . mktime(0, 0, 0, date('m'), date('d') - 30, date('Y')) . " AND " . time() . ")");
    while ($row99 = $sql99->db_Fetch()) {
        $count30_member = $row99['count(*)'];
    }
    $sql99->db_Select_gen("SELECT count(*) FROM " . MPREFIX . DKPDB_TABLE_RAIDS . " r, " . MPREFIX . DKPDB_TABLE_RAID_A . " ra WHERE (ra.raid_id = r.raid_id) AND (ra.member_name='" . $character_name . "') AND (r.raid_date BETWEEN " . mktime(0, 0, 0, date('m'), date('d') - 60, date('Y')) . " AND " . time() . ")");
    while ($row99 = $sql99->db_Fetch()) {
        $count60_member = $row99['count(*)'];
    }
    $sql99->db_Select_gen("SELECT count(*) FROM " . MPREFIX . DKPDB_TABLE_RAIDS . " r, " . MPREFIX . DKPDB_TABLE_RAID_A . " ra WHERE (ra.raid_id = r.raid_id) AND (ra.member_name='" . $character_name . "') AND (r.raid_date BETWEEN " . mktime(0, 0, 0, date('m'), date('d') - 90, date('Y')) . " AND " . time() . ")");
    while ($row99 = $sql99->db_Fetch()) {
        $count90_member = $row99['count(*)'];
    }
    $percent30 = $count30_total > 0 ? round($count30_member / $count30_total * 100) : 0;
    $percent60 = $count60_total > 0 ? round($count60_member / $count60_total * 100) : 0;
    $percent90 = $count90_total > 0 ? round($count90_member / $count90_total * 100) : 0;
    $return_array = array();
    array_push($return_array, $percent30, $percent60, $percent90);
    return $return_array;
}
开发者ID:slijm,项目名称:e107dkp,代码行数:25,代码来源:core.php

示例2: db

 function get_current_table($table_name, $prefix = "")
 {
     global $sql;
     if (!isset($sql)) {
         $sql = new db();
     }
     if (!$prefix) {
         $prefix = MPREFIX;
     }
     //	echo "Get table structure for: {$table_name}, prefix: {$prefix}<br />";
     $sql->db_Select_gen('SET SQL_QUOTE_SHOW_CREATE = 1');
     $qry = 'SHOW CREATE TABLE `' . $prefix . $table_name . "`";
     if (!($z = $sql->db_Select_gen($qry))) {
         return FALSE;
     }
     $row = $sql->db_Fetch(MYSQL_NUM);
     $tmp = str_replace("`", "", stripslashes($row[1])) . ';';
     // Add semicolon to work with our parser
     $count = preg_match_all("#CREATE\\s+?TABLE\\s+?`{0,1}({$prefix}{$table_name})`{0,1}\\s+?\\((.*?)\\)\\s+?(?:TYPE|ENGINE)\\s*\\=\\s*(.*?);#is", $tmp, $matches, PREG_SET_ORDER);
     if ($count === FALSE) {
         return "Error occurred";
     }
     if (!$count) {
         return "No matches";
     }
     return $matches;
 }
开发者ID:notzen,项目名称:e107,代码行数:27,代码来源:db_table_admin_class.php

示例3: 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

示例4: 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

示例5: search_content

function search_content($row)
{
    global $con;
    $sqlCon = new db();
    // Use a separate DB to avoid interfering with main query
    $res['link'] = e_PLUGIN . "content/content.php?content." . $row['content_id'];
    $res['pre_title'] = "";
    $res['title'] = $row['content_heading'];
    $res['summary'] = $row['content_summary'] . ' ' . $row['content_text'];
    //get category heading
    if ($row['content_parent'] == '0') {
        $qry = "\n\t\tSELECT c.content_heading\n\t\tFROM #pcontent as c\n\t\tWHERE c.content_id = '" . $row['content_id'] . "' ";
    } elseif (strpos($row['content_parent'], "0.") !== FALSE) {
        $tmp = explode(".", $row['content_parent']);
        $qry = "\n\t\tSELECT c.content_heading\n\t\tFROM #pcontent as c\n\t\tWHERE c.content_id = '" . intval($tmp[1]) . "' ";
    } else {
        $qry = "\n\t\tSELECT c.*, p.*\n\t\tFROM #pcontent as c\n\t\tLEFT JOIN #pcontent as p ON p.content_id = c.content_parent\n\t\tWHERE c.content_id = '" . $row['content_id'] . "' ";
    }
    $sqlCon->db_Select_gen($qry);
    $cat = $sqlCon->db_Fetch();
    $res['detail'] = LAN_SEARCH_3 . $con->convert_date($row['content_datestamp'], "long") . " " . CONT_SCH_LAN_4 . " " . $cat['content_heading'];
    return $res;
}
开发者ID:Jimmi08,项目名称:content,代码行数:23,代码来源:search_parser.php

示例6: AND

 function view_faq($idx)
 {
     global $ns, $row, $sql, $aj, $pref, $cobj, $id, $tp, $FAQ_VIEW_TEMPLATE;
     //require_once (e_PLUGIN."faqs/faqs_shortcodes.php");
     $sc = e107::getScBatch('faqs', TRUE);
     $sql->db_Select("faqs", "*", "faq_id='{$idx}' LIMIT 1");
     $row = $sql->db_Fetch();
     $sc->setVars($row);
     $caption = "&nbsp;FAQ #" . $row['faq_id'];
     $text = $tp->parseTemplate($FAQ_VIEW_TEMPLATE, true);
     //	$text = $tp->toHTML($text, TRUE);
     $ret['text'] = $text;
     $ret['caption'] = $caption;
     $ret['title'] = $row['faq_question'];
     $ret['comments'] = $text;
     return $ret;
     $subject = !$subject ? $aj->formtpa($faq_question) : $subject;
     if (check_class($row['faq_comment'])) {
         $action = "comment";
         $table = "faq";
         $query = $pref['nested_comments'] ? "comment_item_id='{$idx}' AND (comment_type='{$table}' OR comment_type='3') AND comment_pid='0' ORDER BY comment_datestamp" : "comment_item_id='{$idx}' AND (comment_type='{$table}' OR comment_type='3') ORDER BY comment_datestamp";
         unset($text);
         if (!is_object($sql2)) {
             $sql2 = new db();
         }
         if ($comment_total = $sql2->db_Select("comments", "*", $query)) {
             $width = 0;
             while ($row = $sql2->db_Fetch()) {
                 if ($pref['nested_comments']) {
                     $text = $cobj->render_comment($row, $table, $action, $idx . "." . $id, $width, $subject);
                     $ns->tablerender(FAQLAN_38, $text);
                 } else {
                     $text .= $cobj->render_comment($row, $table, $action, $idx . "." . $id, $width, $subject);
                 }
             }
             if (!$pref['nested_comments']) {
                 $ns->tablerender(LAN_COMMENTS, $text);
             }
             if (ADMIN && getperms("B")) {
                 // bkwon 05-Jun-2004 fix URL to moderate comment
                 echo "<div style='text-align:right'><a href='" . e_ADMIN . "modcomment.php?faq.{$faq_id}'>moderate comments</a></div><br />";
             }
         }
         $cobj->form_comment($action, $table, $idx . "." . $id, $subject, $content_type);
     }
     // end of check_class
 }
开发者ID:armpit,项目名称:e107,代码行数:47,代码来源:faqs.php

示例7: print_item_pdf

function print_item_pdf($id)
{
    global $tp, $pref, $content_shortcodes;
    global $CONTENT_PRINT_IMAGES, $row, $content_image_path, $content_pref, $mainparent;
    //in this section you decide what to needs to be output to the pdf file
    $con = new convert();
    require_once e_PLUGIN . "content/content_shortcodes.php";
    require_once e_PLUGIN . "content/handlers/content_class.php";
    $aa = new content();
    if (!is_object($sql)) {
        $sql = new db();
    }
    $sql->db_Select($plugintable, "content_id, content_heading, content_subheading, content_text, content_image, content_author, content_parent, content_datestamp, content_class, content_pref", "content_id='" . intval($id) . "' ");
    $row = $sql->db_Fetch();
    if (!check_class($row['content_class'])) {
        header("location:" . e_PLUGIN . "content/content.php");
        exit;
    }
    $authordetails = $aa->getAuthor($row['content_author']);
    $row['content_datestamp'] = $con->convert_date($row['content_datestamp'], "long");
    $img = $tp->parseTemplate('{CONTENT_PRINT_IMAGES}', FALSE, $content_shortcodes);
    $mainparent = $aa->getMainParent(intval($id));
    $content_pref = $aa->getContentPref($mainparent);
    $content_icon_path = $tp->replaceConstants($content_pref["content_icon_path"]);
    $content_image_path = $tp->replaceConstants($content_pref["content_image_path"]);
    $img = $tp->parseTemplate('{CONTENT_PDF_IMAGES}', FALSE, $content_shortcodes);
    //add custom and preset tags if present
    $custom = e107::unserialize($row['content_pref']);
    //$custom						= $eArrayStorage->ReadxxxArray($row['content_pref']);
    $months = array(CONTENT_ADMIN_DATE_LAN_0, CONTENT_ADMIN_DATE_LAN_1, CONTENT_ADMIN_DATE_LAN_2, CONTENT_ADMIN_DATE_LAN_3, CONTENT_ADMIN_DATE_LAN_4, CONTENT_ADMIN_DATE_LAN_5, CONTENT_ADMIN_DATE_LAN_6, CONTENT_ADMIN_DATE_LAN_7, CONTENT_ADMIN_DATE_LAN_8, CONTENT_ADMIN_DATE_LAN_9, CONTENT_ADMIN_DATE_LAN_10, CONTENT_ADMIN_DATE_LAN_11);
    $CONTENT_CONTENT_TABLE_CUSTOM_TAGS = "";
    if (!empty($custom)) {
        foreach ($custom as $k => $v) {
            if ($k == "content_custom_presettags") {
                if (isset($content_pref["content_content_presettags"]) && $content_pref["content_content_presettags"]) {
                    foreach ($v as $ck => $cv) {
                        if (is_array($cv)) {
                            //date
                            if (!($cv['day'] == "" && $cv['month'] == "" && $cv['year'] == "")) {
                                $vv = $cv['day'] . " " . $months[$cv['month'] - 1] . " " . $cv['year'];
                            }
                        } else {
                            $vv = $cv;
                        }
                        if (isset($ck) && $ck != "" && isset($vv) && $vv != "") {
                            $CUSTOM_TAGS = TRUE;
                            $CONTENT_CONTENT_TABLE_CUSTOM_KEY = $tp->toHTML($ck, true);
                            $CONTENT_CONTENT_TABLE_CUSTOM_VALUE = $tp->toHTML($vv, true);
                            $CONTENT_CONTENT_TABLE_CUSTOM_TAGS .= $CONTENT_CONTENT_TABLE_CUSTOM_KEY . " : " . $CONTENT_CONTENT_TABLE_CUSTOM_VALUE . "<br />";
                        }
                    }
                }
            } else {
                if (isset($content_pref["content_content_customtags"]) && $content_pref["content_content_customtags"]) {
                    $key = substr($k, 15);
                    if (isset($key) && $key != "" && isset($v) && $v != "") {
                        $CUSTOM_TAGS = TRUE;
                        $CONTENT_CONTENT_TABLE_CUSTOM_KEY = $tp->toHTML($key, true);
                        $CONTENT_CONTENT_TABLE_CUSTOM_VALUE = $tp->toHTML($v, true);
                        $CONTENT_CONTENT_TABLE_CUSTOM_TAGS .= $CONTENT_CONTENT_TABLE_CUSTOM_KEY . " : " . $CONTENT_CONTENT_TABLE_CUSTOM_VALUE . "<br />";
                    }
                }
            }
        }
    }
    $text = "\n\t<b>" . $row['content_heading'] . "</b><br />\n\t" . $row['content_subheading'] . "<br />\n\t" . $authordetails[1] . ", " . $row['content_datestamp'] . "<br />\n\t<br />\n\t" . $row['content_text'] . "<br />\n\t" . ($CONTENT_CONTENT_TABLE_CUSTOM_TAGS ? $CONTENT_CONTENT_TABLE_CUSTOM_TAGS : "") . "\n\t<div style='float:left; padding-left:10px;'>" . $img . "</div>\n\t";
    //the following defines are processed in the document properties of the pdf file
    //Do NOT add parser function to the variables, leave them as raw data !
    //as the pdf methods will handle this !
    $text = $text;
    //define text
    $creator = SITENAME;
    //define creator
    $author = $authordetails[1];
    //define author
    $title = $row['content_heading'];
    //define title
    $subject = $row['content_subheading'];
    //define subject
    $keywords = "";
    //define keywords
    //define url to use in the header of the pdf file
    $url = SITEURLBASE . e_PLUGIN_ABS . "content/content.php?content." . $row['content_id'];
    //always return an array with the following data:
    return array($text, $creator, $author, $title, $subject, $keywords, $url);
}
开发者ID:Jimmi08,项目名称:content,代码行数:86,代码来源:e_emailprint.php

示例8: doMaint

/**
 * 	Do PM DB maintenance
 *	@param array $opts of tasks key = sent|rec|blocked|expired  (one or more present). ATM value not used
 *	@return array where key is message type (E_MESSAGE_SUCCESS|E_MESSAGE_ERROR|E_MESSAGE_INFO etc), data is array of messages of that type (key = timestamp)
 */
function doMaint($opts, $pmPrefs)
{
    if (!count($opts)) {
        return array(E_MESSAGE_ERROR => array(ADLAN_PM_66));
    }
    $results = array(E_MESSAGE_INFO => array(ADLAN_PM_67));
    // 'Maintenance started' - primarily for a log entry to mark start time
    $logResults = array();
    $e107 = e107::getInstance();
    $e107->admin_log->log_event('PM_ADM_04', implode(', ', array_keys($opts)));
    $pmHandler = new private_message($pmPrefs);
    $db2 = new db();
    // Will usually need a second DB object to avoid over load
    $start = 0;
    // Use to ensure we get different log times
    if (isset($opts['sent'])) {
        $cnt = 0;
        if ($res = $db2->gen("SELECT pm.pm_id FROM `#private_msg` AS pm LEFT JOIN `#user` AS u ON pm.`pm_from` = `#user`.`user_id`\n\t\t\t\t\tWHERE (pm.`pm_read_del = 1) AND `#user`.`user_id` IS NULL")) {
            while ($row = $db2->fetch(MYSQL_ASSOC)) {
                if ($pmHandler->del($row['pm_id']) !== FALSE) {
                    $cnt++;
                }
            }
        }
        $start = time();
        $results[E_MESSAGE_SUCCESS][$start] = str_replace('--COUNT--', $cnt, ADLAN_PM_74);
    }
    if (isset($opts['rec'])) {
        $cnt = 0;
        if ($res = $db2->gen("SELECT pm.pm_id FROM `#private_msg` AS pm LEFT JOIN `#user` AS u ON pm.`pm_to` = `#user`.`user_id`\n\t\t\t\t\tWHERE (pm.`pm_sent_del = 1) AND `#user`.`user_id` IS NULL")) {
            while ($row = $db2->fetch(MYSQL_ASSOC)) {
                if ($pmHandler->del($row['pm_id']) !== FALSE) {
                    $cnt++;
                }
            }
        }
        $start = max($start + 1, time());
        $results[E_MESSAGE_SUCCESS][$start] = str_replace('--COUNT--', $cnt, ADLAN_PM_75);
    }
    if (isset($opts['blocked'])) {
        if ($res = $db2->gen("DELETE `#private_msg_block` FROM `#private_msg_block` LEFT JOIN `#user` ON `#private_msg_block`.`pm_block_from` = `#user`.`user_id`\n\t\t\t\t\tWHERE `#user`.`user_id` IS NULL")) {
            $start = max($start + 1, time());
            $results[E_MESSAGE_ERROR][$start] = str_replace(array('--NUM--', '--TEXT--'), array($this->sql->getLastErrorNum, $this->sql->getLastErrorText), ADLAN_PM_70);
        } else {
            $start = max($start + 1, time());
            $results[E_MESSAGE_SUCCESS][$start] = str_replace('--COUNT--', $res, ADLAN_PM_69);
        }
        if ($res = $db2->gen("DELETE `#private_msg_block` FROM `#private_msg_block` LEFT JOIN `#user` ON `#private_msg_block`.`pm_block_to` = `#user`.`user_id`\n\t\t\t\t\tWHERE `#user`.`user_id` IS NULL")) {
            $start = max($start + 1, time());
            $results[E_MESSAGE_ERROR][$start] = str_replace(array('--NUM--', '--TEXT--'), array($this->sql->getLastErrorNum, $this->sql->getLastErrorText), ADLAN_PM_70);
        } else {
            $start = max($start + 1, time());
            $results[E_MESSAGE_SUCCESS][$start] = str_replace('--COUNT--', $res, ADLAN_PM_68);
        }
    }
    if (isset($opts['expired'])) {
        $del_qry = array();
        $read_timeout = intval($pmPrefs['read_timeout']);
        $unread_timeout = intval($pmPrefs['unread_timeout']);
        if ($read_timeout > 0) {
            $timeout = time() - $read_timeout * 86400;
            $del_qry[] = "(pm_sent < {$timeout} AND pm_read > 0)";
        }
        if ($unread_timeout > 0) {
            $timeout = time() - $unread_timeout * 86400;
            $del_qry[] = "(pm_sent < {$timeout} AND pm_read = 0)";
        }
        if (count($del_qry) > 0) {
            $qry = implode(' OR ', $del_qry);
            $cnt = 0;
            if ($db2->db_Select('private_msg', 'pm_id', $qry)) {
                while ($row = $db2->db_Fetch(MYSQL_ASSOC)) {
                    if ($pmHandler->del($row['pm_id']) !== FALSE) {
                        $cnt++;
                    }
                }
            }
            $start = max($start + 1, time());
            $results[E_MESSAGE_SUCCESS][$start] = str_replace('--COUNT--', $cnt, ADLAN_PM_73);
        } else {
            $start = max($start + 1, time());
            $results[E_MESSAGE_ERROR][$start] = ADLAN_PM_72;
        }
    }
    if (isset($opts['attach'])) {
        // Check for orphaned and missing attachments
        require_once e_HANDLER . 'file_class.php';
        $fl = new e_file();
        $missing = array();
        $orphans = array();
        $fileArray = $fl->get_files(e_PLUGIN . 'pm/attachments');
        if ($db2->select('private_msg', 'pm_id, pm_attachments', "pm_attachments != ''")) {
            while ($row = $db2->fetch(MYSQL_ASSOC)) {
                $attachList = explode(chr(0), $row['pm_attachments']);
                foreach ($attachList as $a) {
//.........这里部分代码省略.........
开发者ID:armpit,项目名称:e107,代码行数:101,代码来源:pm_conf.php

示例9: urlencode

// 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);
if (!$fp) {
开发者ID:nlstart,项目名称:easyshop,代码行数:31,代码来源:validate.php

示例10: Marchais

// Plugin info -------------------------------------------------------------------------------------------------------
$eplug_name = EB_L1;
$eplug_version = "{$majorRevision}.{$minorRevision}.{$revRevision}";
$eplug_author = "Frederic Marchais (qam4)";
$eplug_logo = "";
$eplug_url = "http://www.ebattles.net";
$eplug_email = "frederic.marchais@gmail.com";
$eplug_description = EB_L2;
$eplug_compatible = "e107v0.7+";
$eplug_compliant = TRUE;
// indicator if plugin is XHTML compliant, shows icon
$eplug_readme = "";
// leave blank if no readme file
$eb_SQL = new db();
$eb_SQL->db_Select("plugin", "plugin_version", "plugin_path='ebattles' AND plugin_installflag > 0");
list($eb_version_string) = $eb_SQL->db_Fetch();
$eb_version_string = preg_replace("/[a-zA-z\\s]/", '', $eb_version_string);
$eb_version = explode('.', $eb_version_string, 3);
// Name of the plugin's folder -------------------------------------------------------------------------------------
$eplug_folder = "ebattles";
// Name of menu item for plugin ----------------------------------------------------------------------------------
$eplug_menu_name = TRUE;
// Name of the admin configuration file --------------------------------------------------------------------------
$eplug_conffile = "admin_config.php";
// Icon image and caption text ------------------------------------------------------------------------------------
$eplug_icon = $eplug_folder . "/images/ebattles_32.ico";
$eplug_icon_small = $eplug_folder . "/images/ebattles_16.ico";
//$eplug_caption =  EB_L3;
// List of preferences -----------------------------------------------------------------------------------------------
$eplug_prefs = array("eb_events_update_delay" => 60, "eb_events_update_delay_enable" => 0, "eb_mod_class" => e_UC_ADMIN, "eb_events_create_class" => e_UC_MEMBER, "eb_teams_create_class" => e_UC_MEMBER, "eb_media_submit_class" => e_UC_MEMBER, "eb_tab_theme" => 'default', "eb_max_image_size_check" => 1, "eb_max_image_size" => 16, "eb_default_items_per_page" => 25, "eb_max_avatar_size" => 32, "eb_avatar_enable_playersstandings" => 1, "eb_avatar_default_image" => 'anonymous.png', "eb_avatar_enable_teamsstandings" => 1, "eb_avatar_enable_teamslist" => 1, "eb_avatar_default_team_image" => 'default_group_avatar.png', "eb_links_menuheading" => EB_ADMIN_L29, "eb_activity_menuheading" => EB_ADMIN_L31, "eb_activity_number_of_items" => 10, "eb_activity_max_image_size_check" => 1, "eb_activity_max_image_size" => 16, "eb_disclaimer" => EB_ADMIN_L37, "eb_max_number_media" => 3, "eb_max_map_image_size_check" => 1, "eb_max_map_image_size" => 80, "eb_pm_notifications_class" => e_UC_MEMBER, "eb_email_notifications_class" => e_UC_NOBODY, "eb_links_showcreateevent" => 1, "eb_links_showcreateteam" => 1, "eb_links_showmatchsplayed" => 1, "eb_links_showmatchstoapprove" => 1, "eb_links_showmatchspending" => 1, "eb_links_showmatchesscheduled" => 1, "eb_links_showchallengesrequested" => 1, "eb_links_showchallengesunconfirmed" => 1, "eb_gold_active" => false, "eb_gold_userclass" => e_UC_ADMIN, "eb_gold_playmatch" => 0);
// List of table names -----------------------------------------------------------------------------------------------
开发者ID:testt98,项目名称:ebattles,代码行数:31,代码来源:plugin.php

示例11: db

    // End of while for main categories
}
// End of if active main categories count > 0
// Select all active categories without main category  (Remain backwards compatible with EasyShop 1.2 AND main category is not mandatory)
$sql1 = new db();
$sql1->db_Select(DB_TABLE_SHOP_ITEM_CATEGORIES, "*", "category_active_status = '2' AND category_main_id='' AND (category_class IN (" . USERCLASS_LIST . ")) ");
while ($row1 = $sql1->db_Fetch()) {
    $category_id = $row1['category_id'];
    $category_name = $row1['category_name'];
    $sql2 = new db();
    // Count all active products of the fetched category
    $active_prod_count = $sql2->db_Count(DB_TABLE_SHOP_ITEMS, "(*)", "WHERE item_active_status = '2' AND category_id={$category_id}");
    $l_text .= "<tr><td>&nbsp;&nbsp;<a href='" . e_PLUGIN . "easyshop/easyshop.php?cat.{$category_id}'><b>" . $category_name . "</b></a> ({$active_prod_count})</td></tr>";
    $active_prod_count > 0 ? $l_text .= "<tr><td><ul>" : "";
    // For valid XHTML 1.1
    $sql3 = new db();
    // Select all active products of the fetched category
    $sql3->db_Select(DB_TABLE_SHOP_ITEMS, "*", "item_active_status = '2' AND category_id={$category_id} ORDER BY item_order");
    while ($row3 = $sql3->db_Fetch()) {
        $item_id = $row3['item_id'];
        $item_name = $row3['item_name'];
        $l_text .= "<li><a href='" . e_PLUGIN . "easyshop/easyshop.php?prod.{$item_id}'>" . $item_name . "</a></li>";
    }
    // End of while for products
    $active_prod_count > 0 ? $l_text .= "</ul></td></tr>" : "";
    // For valid XHTML 1.1
}
// End of while for categories
$l_text .= "</table>";
$caption = "<div style='text-align:center;'>" . EASYSHOP_PUBLICMENU2_01 . " (" . ($active_main_count > 0 ? $active_main_count : $active_cat_count) . ")</div>";
$ns->tablerender($caption, $l_text);
开发者ID:nlstart,项目名称:easyshop,代码行数:31,代码来源:easyshop_list_menu.php

示例12: define

 /**
  * Render a single comment and any nested comments it may have. 
  *
  * @param array $row
  * @param string $table
  * @param string $action
  * @param integer $id
  * @param interger $width
  * @param string $subject
  * @param integer $addrating
  * @return html
  */
 function render_comment($row, $table, $action, $id, $width, $subject, $addrating = FALSE)
 {
     //addrating	: boolean, to show rating system in rendered comment
     global $sc_style, $gen;
     $tp = e107::getParser();
     $sql = e107::getDb();
     $pref = e107::getPref();
     if (vartrue($pref['comments_disabled'])) {
         return;
     }
     global $NEWIMAGE, $USERNAME, $RATING, $datestamp;
     global $thisaction, $thistable, $thisid, $e107;
     $comrow = $row;
     $thistable = $table;
     $thisid = $id;
     $thisaction = $action;
     //FIXME - new level handler, currently commented to avoid parse errors
     //require_once (e_HANDLER."level_handler.php");
     if (!$width) {
         $width = 0;
     }
     if (!defined("IMAGE_nonew_comments")) {
         define("IMAGE_nonew_comments", file_exists(THEME . "images/nonew_comments.png") ? "<img src='" . THEME_ABS . "images/nonew_comments.png' alt=''  /> " : "<img src='" . e_IMAGE_ABS . "generic/nonew_comments.png' alt=''  />");
     }
     if (!defined("IMAGE_new_comments")) {
         define("IMAGE_new_comments", file_exists(THEME . "images/new_comments.png") ? "<img src='" . THEME_ABS . "images/new_comments.png' alt=''  /> " : "<img src='" . e_IMAGE_ABS . "generic/new_comments.png' alt=''  /> ");
     }
     //		$ns = new e107table;
     if (!$gen || !is_object($gen)) {
         $gen = new convert();
     }
     $row['rating_enabled'] = true;
     // Toggles rating shortcode. //TODO add pref
     e107::getScBatch('comment')->setVars($row);
     $COMMENT_TEMPLATE = $this->template;
     $COMMENT_TEMPLATE['ITEM_START'] = "\n\n<div id='{COMMENT_ITEMID}' class='comment-box clearfix'>\n";
     $COMMENT_TEMPLATE['ITEM_END'] = "\n</div><div class='clear_b'><!-- --></div>\n";
     if (vartrue($pref['nested_comments'])) {
         $width2 = 100 - $width;
         $total_width = "95%";
         if ($width) {
             $renderstyle = $COMMENT_TEMPLATE['ITEM_START'];
             $renderstyle .= "<div style='margin-left:{$width}%'>" . $COMMENT_TEMPLATE['ITEM'] . "</div>";
             $renderstyle .= $COMMENT_TEMPLATE['ITEM_END'];
         } else {
             $renderstyle = $COMMENT_TEMPLATE['ITEM_START'] . $COMMENT_TEMPLATE['ITEM'] . $COMMENT_TEMPLATE['ITEM_END'];
         }
         if ($pref['comments_icon']) {
             if ($comrow['comment_datestamp'] > USERLV) {
                 $NEWIMAGE = IMAGE_new_comments;
             } else {
                 $NEWIMAGE = IMAGE_nonew_comments;
             }
         } else {
             $NEWIMAGE = "";
         }
     } else {
         $renderstyle = $COMMENT_TEMPLATE['ITEM'];
     }
     $highlight_search = FALSE;
     if (isset($_POST['highlight_search'])) {
         $highlight_search = TRUE;
     }
     if (!defined("IMAGE_rank_main_admin_image")) {
         define("IMAGE_rank_main_admin_image", isset($pref['rank_main_admin_image']) && $pref['rank_main_admin_image'] && file_exists(THEME . "forum/" . $pref['rank_main_admin_image']) ? "<img src='" . THEME_ABS . "forum/" . $pref['rank_main_admin_image'] . "' alt='' />" : "<img src='" . e_PLUGIN_ABS . "forum/images/lite/main_admin.png' alt='' />");
     }
     if (!defined("IMAGE_rank_moderator_image")) {
         define("IMAGE_rank_moderator_image", isset($pref['rank_moderator_image']) && $pref['rank_moderator_image'] && file_exists(THEME . "forum/" . $pref['rank_moderator_image']) ? "<img src='" . THEME_ABS . "forum/" . $pref['rank_moderator_image'] . "' alt='' />" : "<img src='" . e_PLUGIN_ABS . "forum/images/lite/admin.png' alt='' />");
     }
     if (!defined("IMAGE_rank_admin_image")) {
         define("IMAGE_rank_admin_image", isset($pref['rank_admin_image']) && $pref['rank_admin_image'] && file_exists(THEME . "forum/" . $pref['rank_admin_image']) ? "<img src='" . THEME_ABS . "forum/" . $pref['rank_admin_image'] . "' alt='' />" : "<img src='" . e_PLUGIN_ABS . "forum/images/lite/admin.png' alt='' />");
     }
     //	$RATING = ($addrating == TRUE && $comrow['user_id'] ? $rater->composerating($thistable, $thisid, FALSE, $comrow['user_id']) : "");
     $comment_shortcodes = e107::getScBatch('comment');
     $text = $tp->parseTemplate($renderstyle, TRUE, $comment_shortcodes);
     //FIXME - dramatically increases the number of queries performed.
     if ($action == "comment" && vartrue($pref['nested_comments'])) {
         $type = $this->getCommentType($thistable);
         $sub_query = "\n\t\t\tSELECT c.*, u.*, ue.*, r.*\n\t\t\tFROM #comments AS c\n\t\t\tLEFT JOIN #user AS u ON c.comment_author_id = u.user_id\n\t\t\tLEFT JOIN #user_extended AS ue ON c.comment_author_id = ue.user_extended_id\n\t\t\tLEFT JOIN #rate AS r ON c.comment_id = r.rate_itemid AND r.rate_table = 'comments' \n\t\t\t\n\t\t\tWHERE comment_item_id='" . intval($thisid) . "' AND comment_type='" . $tp->toDB($type, true) . "' AND comment_pid='" . intval($comrow['comment_id']) . "'\n\t\t\t\n\t\t\t\n\t\t\tORDER BY comment_datestamp\n\t\t\t";
         $sql_nc = new db();
         /* a new db must be created here, for nested comment  */
         if ($sub_total = $sql_nc->db_Select_gen($sub_query)) {
             while ($row1 = $sql_nc->db_Fetch()) {
                 if ($this->isPending($row1)) {
                     $sub_total = $sub_total - 1;
                     continue;
                 }
                 if ($pref['nested_comments']) {
//.........这里部分代码省略.........
开发者ID:notzen,项目名称:e107,代码行数:101,代码来源:comment_class.php

示例13: editPost

function editPost($xmlrpcmsg)
{
    $postid = $xmlrpcmsg->getParam(0)->scalarval();
    $username = $xmlrpcmsg->getParam(1)->scalarval();
    $password = $xmlrpcmsg->getParam(2)->scalarval();
    if (userLogin($username, $password, 'H') == true) {
        $content = $xmlrpcmsg->getParam(3);
        $title = $content->structMem('title')->scalarval();
        $description = '[html]' . $content->structMem('description')->scalarval() . '[/html]';
        //22/10/2009 14.48.04 added mt_text_more ie news_extended
        //check if we have something...
        $tempTextMore = checkXmlElementS($content->serialize(), 'mt_text_more');
        if ($tempTextMore == 1) {
            $mt_text_more = '[html]' . $content->structMem('mt_text_more')->scalarval() . '[/html]';
        }
        //if date is null will be replaced with current datetime (wordpress like)
        //check with simplexml for the parameter dateCreated? XMLRPC-PHP seems to not have such functions??
        $tempDate = checkXmlElementS($content->serialize(), 'dateCreated');
        if ($tempDate == 1) {
            $dateCreated = $content->structMem('dateCreated')->serialize();
            // Not all clients send dateCreated info. So add if statement here if you want to use it.
            $timestamp = iso8601_decode($dateCreated);
            // To convert to unix timestamp
        } else {
            $timestamp = time();
        }
        //22/10/2009 11.51.54 added $mt_excerpt
        //add the news summary
        //check if we have something...
        $tempExcerpt = checkXmlElementS($content->serialize(), 'mt_excerpt');
        if ($tempExcerpt == 1) {
            $mt_excerpt = $content->structMem('mt_excerpt')->scalarval();
        }
        //22/10/2009 11.51.54 added $mt_allow_comments
        //add the news_allow_comments flag
        //check if we have something...
        $tempAllowComments = checkXmlElementS($content->serialize(), 'mt_allow_comments');
        if ($tempAllowComments == 1) {
            $mt_allow_comments = $content->structMem('mt_allow_comments')->scalarval();
        }
        //26/10/2009 14.30.41 added mt_keywords ie tags
        //check if we have something...
        $tempKeywords = checkXmlElementS($content->serialize(), 'mt_keywords');
        if ($tempKeywords == 1) {
            $mt_keywords = $content->structMem('mt_keywords')->scalarval();
        }
        //author from e107
        $query = 'SELECT u.user_id FROM `#user` AS u WHERE u.user_loginname = \'' . $username . '\' AND u.user_password = \'' . md5($password) . '\'';
        $sql = new db();
        $sql->db_Select_gen($query);
        $row = $sql->db_Fetch();
        $author = $row['user_id'];
        if ($content->structMem('categories')->arraySize() > 0) {
            $categories = $content->structMem('categories')->arrayMem(0)->scalarval();
            //try to read out the id of the category
            if ($categories != '') {
                $query = 'SELECT c.category_id FROM `#news_category` AS c WHERE c.category_name = \'' . $categories . '\'';
                $sql->db_Select_gen($query);
                $row = $sql->db_Fetch();
                $categories = $row['category_id'];
            }
        }
        $published = $xmlrpcmsg->getParam(4)->scalarval();
        // TODO use:
        // $ix = new news;
        // $ret = $ix->submit_item($arrayvalues);
        //edit data with new fuctions
        $data = array();
        //to update we need to set news id...
        $data['data']['news_id'] = $postid;
        $data['_FIELD_TYPES']['news_id'] = 'int';
        $data['data']['news_title'] = $title;
        $data['_FIELD_TYPES']['news_title'] = 'todb';
        $data['data']['news_body'] = $description;
        $data['_FIELD_TYPES']['news_body'] = 'todb';
        $data['data']['news_extended'] = $mt_text_more;
        $data['_FIELD_TYPES']['news_extended'] = 'todb';
        $data['data']['news_datestamp'] = $timestamp;
        $data['_FIELD_TYPES']['news_datestamp'] = 'int';
        $data['data']['news_author'] = $author;
        $data['_FIELD_TYPES']['news_author'] = 'int';
        $data['data']['news_category'] = $categories;
        //category id is taken by a query against news categories
        $data['_FIELD_TYPES']['news_category'] = 'int';
        $data['data']['news_allow_comments'] = $mt_allow_comments;
        $data['_FIELD_TYPES']['news_allow_comments'] = 'int';
        $data['data']['news_start'] = '';
        //NOT AVAIBLE MAKE A CUSTOM FIELD?
        $data['_FIELD_TYPES']['news_start'] = 'int';
        $data['data']['news_end'] = '';
        //NOT AVAIBLE MAKE A CUSTOM FIELD?
        $data['_FIELD_TYPES']['news_end'] = 'int';
        //$data['data']['news_class'] = $news['news_class'];
        //$data['_FIELD_TYPES']['news_class'] = 'todb';
        $data['data']['news_render_type'] = eXMLRPC_NEWS_RENDER_TYPE_LOC;
        //from preferences
        $data['_FIELD_TYPES']['news_render_type'] = 'int';
        //news_comment_total
        $data['data']['news_summary'] = $mt_excerpt;
        //NOT AVAIBLE MAKE A CUSTOM FIELD?
//.........这里部分代码省略.........
开发者ID:armpit,项目名称:e107,代码行数:101,代码来源:metaweblog.php

示例14: 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

示例15: IN

             $rss[$i]['link'] = $e107->base_path . $PLUGINS_DIRECTORY . "forum/forum_viewtopic.php?" . $value['thread_id'];
         }
         $rss[$i]['description'] = $value['thread_thread'];
         $rss[$i]['datestamp'] = $value['thread_datestamp'];
         $i++;
     }
     break;
 case topic:
 case 8:
     if (!$this->topicid) {
         return FALSE;
     }
     /* get thread ...  */
     $this->rssQuery = "SELECT t.thread_name, t.thread_thread, t.thread_id, t.thread_name, t.thread_datestamp, t.thread_parent, t.thread_user, t.thread_views, t.thread_lastpost, f.forum_id, f.forum_name, f.forum_class, u.user_name\n\t\tFROM #forum_t AS t\n\t\tLEFT JOIN #user AS u ON SUBSTRING_INDEX(t.thread_user,'.',1) = u.user_id\n\t\tLEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id\n\t\tWHERE f.forum_class  IN (" . USERCLASS_LIST . ") AND t.thread_id=" . intval($this->topicid);
     $sqlrss->db_Select_gen($this->rssQuery);
     $topic = $sqlrss->db_Fetch();
     /* get replies ...  */
     $this->rssQuery = "SELECT t.thread_name, t.thread_thread, t.thread_id, t.thread_name, t.thread_datestamp, t.thread_parent, t.thread_user, t.thread_views, t.thread_lastpost, f.forum_id, f.forum_name, f.forum_class, u.user_name, u.user_email\n\t\tFROM #forum_t AS t\n\t\tLEFT JOIN #user AS u ON SUBSTRING_INDEX(t.thread_user,'.',1) = u.user_id\n\t\tLEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id\n\t\tWHERE f.forum_class  IN (" . USERCLASS_LIST . ") AND t.thread_parent=" . intval($this->topicid);
     $sqlrss->db_Select_gen($this->rssQuery);
     $replies = $sqlrss->db_getList();
     $rss = array();
     $i = 0;
     if ($value['user_name']) {
         $rss[$i]['author'] = $value['user_name'] . " ( " . $e107->base_path . "user.php?id." . intval($value['thread_user']) . " )";
     } else {
         $tmp = explode(".", $value['thread_user'], 2);
         list($rss[$i]['author'], $ip) = explode(chr(1), $tmp[1]);
     }
     $rss[$i]['title'] = $topic['thread_name'];
     $rss[$i]['link'] = $e107->base_path . $PLUGINS_DIRECTORY . "forum/forum_viewtopic.php?" . $topic['thread_id'];
     $rss[$i]['description'] = $topic['thread_thread'];
开发者ID:notzen,项目名称:e107,代码行数:31,代码来源:e_rss.php


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