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


PHP e107类代码示例

本文整理汇总了PHP中e107的典型用法代码示例。如果您正苦于以下问题:PHP e107类的具体用法?PHP e107怎么用?PHP e107使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: data

 /**
  * Compile RSS Data
  * @param $parms array	url, limit, id 
  * @return array
  */
 function data($parms = '')
 {
     $sql = e107::getDb();
     $rss = array();
     $i = 0;
     if ($items = $sql->select('chatbox', "*", "cb_blocked=0 ORDER BY cb_datestamp DESC LIMIT 0," . $parms['limit'])) {
         while ($row = $sql->fetch()) {
             $tmp = explode(".", $row['cb_nick']);
             $rss[$i]['author'] = $tmp[1];
             $rss[$i]['author_email'] = '';
             $rss[$i]['link'] = "chatbox_menu/chat.php?" . $row['cb_id'];
             $rss[$i]['linkid'] = $row['cb_id'];
             $rss[$i]['title'] = '';
             $rss[$i]['description'] = $row['cb_message'];
             $rss[$i]['category_name'] = '';
             $rss[$i]['category_link'] = '';
             $rss[$i]['datestamp'] = $row['cb_datestamp'];
             $rss[$i]['enc_url'] = "";
             $rss[$i]['enc_leng'] = "";
             $rss[$i]['enc_type'] = "";
             $i++;
         }
     }
     return $rss;
 }
开发者ID:armpit,项目名称:e107,代码行数:30,代码来源:e_rss.php

示例2: install_post

 /**
  * For inserting default database content during install after table has been created by the test_sql.php file. 
  */
 function install_post($var)
 {
     $sql = e107::getDb();
     $mes = e107::getMessage();
     /*
     		$e107_test = array(
     			'test_id'				=>'1',
     			'test_icon'			=>'{e_PLUGIN}test/images/test_32.png',
     			'test_type'			=>'type_1',
     			'test_name'			=>'My Name',
     			'test_folder'			=>'Folder Value',
     			'test_version'			=>'1',
     			'test_author'			=>'bill',
     			'test_authorURL'		=>'http://e107.org',
     			'test_date'			=>'1352871240',
     			'test_compatibility'	=>'2',
     			'test_url'				=>'http://e107.org'
     		);
     		
     		if($sql->insert('test',$e107_test))
     		{
     			$mes->add("Custom - Install Message.", E_MESSAGE_SUCCESS);
     		}
     		else
     		{
     			$mes->add("Custom - Failed to add default table data.", E_MESSAGE_ERROR);	
     		}*/
 }
开发者ID:Janvrensburg,项目名称:jobtest,代码行数:31,代码来源:test_setup.php

示例3: unanswered

 function unanswered()
 {
     $sql = e107::getDb();
     $tp = e107::getParser();
     $limit = 25;
     $count = $sql->retrieve('faqs', 'faq_id', "faq_answer=''  ", true);
     $existing = $sql->retrieve('faqs', 'faq_id,faq_question,faq_datestamp', "faq_answer=''  ORDER BY faq_datestamp DESC LIMIT " . $limit, true);
     if (empty($existing)) {
         return;
     }
     $questions = array();
     foreach ($existing as $row) {
         $questions[] = "<i>" . $row['faq_question'] . "</i><br /><small>" . $tp->toDate($row['faq_datestamp'], 'short') . "</small>\n";
         //	$questions[] = $row['faq_question'];
     }
     //
     //	$questions = array( "<i>Test Question</i><br /><small>".$tp->toDate(time(),'short')."</small>");
     $name = SITENAME . " Automation";
     $email = e107::pref('core', 'siteadminemail');
     $name = e107::pref('core', 'siteadmin');
     $link = $tp->replaceConstants("{e_PLUGIN}faqs/admin_config.php?mode=main&action=list&filter=pending", 'full');
     $body = "<h2>" . count($count) . " Unuanswered Questions at " . SITENAME . "</h2>To answer these questions, please login to " . SITENAME . " and then <a href='{$link}'>click here</a>.<br />\n\t\t\tThe " . $limit . " most recent questions are displayed below.\n\t\t\t<ul><li>" . implode("</li><li>", $questions) . "</li></ul>";
     $eml = array('subject' => count($count) . " Unuanswered Question as of " . date('d-M-Y') . " ", 'sender_name' => SITENAME . " Automation", 'html' => true, 'template' => 'default', 'body' => $body);
     e107::getEmail()->sendEmail($email, $name, $eml);
 }
开发者ID:armpit,项目名称:e107,代码行数:25,代码来源:e_cron.php

示例4: getlinks

 function getlinks($cat = 1)
 {
     $this->eLinkList = array();
     // clear the array in case getlinks is called 2x on the same page.
     $sql = e107::getDb('sqlSiteLinks');
     $ins = $cat > 0 ? "link_category = " . intval($cat) . " AND " : "";
     $query = "SELECT * FROM #links WHERE " . $ins . "  link_class IN (" . USERCLASS_LIST . ") ORDER BY link_order ASC";
     if ($sql->db_Select_gen($query)) {
         while ($row = $sql->db_Fetch()) {
             if ($row['link_sefurl']) {
                 $this->sefList[$row['link_sefurl']] = $row['link_url'];
             }
             //	if (substr($row['link_name'], 0, 8) == 'submenu.'){
             //		$tmp=explode('.', $row['link_name'], 3);
             //		$this->eLinkList[$tmp[1]][]=$row;
             if (isset($row['link_parent']) && $row['link_parent'] != 0) {
                 $this->eLinkList['sub_' . $row['link_parent']][] = $row;
             } else {
                 $this->eLinkList['head_menu'][] = $row;
                 if (vartrue($row['link_function'])) {
                     list($path, $method) = explode("::", $row['link_function']);
                     if (include_once e_PLUGIN . $path . "/e_sitelink.php") {
                         $class = $path . "_sitelinks";
                         $sublinkArray = e107::callMethod($class, $method);
                         //TODO Cache it.
                         if (vartrue($sublinkArray)) {
                             $this->eLinkList['sub_' . $row['link_id']] = $sublinkArray;
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:notzen,项目名称:e107,代码行数:34,代码来源:sitelinks_class.php

示例5: sc_oneliner

 function sc_oneliner($parm = '')
 {
     $sql = e107::getDb();
     $icon = $this->var['current']['icon'];
     $oneliners = $sql->retrieve('forecasty_oneliners', '*', "`condition`='" . $icon . "' AND `vulgarity`='" . e107::pref('forecasty', 'vulgarity') . "'", true);
     return $oneliners[array_rand($oneliners)]['line'];
 }
开发者ID:gitter-badger,项目名称:forecasty,代码行数:7,代码来源:forecasty_shortcodes.php

示例6: avatar

/**
 * @DEPRECATED 
 * Use e107::getParser()->parseTemplate("{USER_AVATAR=".$avatar."}",true); instead. 
 */
function avatar($avatar)
{
    return e107::getParser()->parseTemplate("{USER_AVATAR=" . $avatar . "}", true);
    /*
    	global $tp;
    	if (stristr($avatar, '-upload-') !== false)
    	{
    		return e_AVATAR_UPLOAD.str_replace('-upload-', '', $avatar);
    	}
    	elseif (stristr($avatar, 'Binary') !== false)
    	{
    		$sqla = new db;
    		preg_match("/Binary\s(.*?)\//", $avatar, $result);
    		$sqla->db_Select('rbinary', '*', "binary_id='".$tp->toDB($result[1])."' ");
    		$row = $sqla->db_Fetch();
    		return $row['binary_data'];
    	}
    	elseif (strpos($avatar, 'http://') === false)
    	{
    		return SITEURLBASE.e_IMAGE_ABS."avatars/".$avatar;
    	}
    	else
    	{
    		return $avatar;
    	}
    */
}
开发者ID:armpit,项目名称:e107,代码行数:31,代码来源:avatar_handler.php

示例7: forum_post_rep

 function forum_post_rep($data)
 {
     $e107 = e107::getInstance();
     include_lan(e_PLUGIN . 'forum/languages/' . e_LANGUAGE . '/lan_forum_notify.php');
     $message = 'todo';
     $e107->notify->send('forum_post_rep', FORUM_NT_9, $message);
 }
开发者ID:notzen,项目名称:e107,代码行数:7,代码来源:e_notify.php

示例8: e_linkwords

 function e_linkwords()
 {
     global $pref, $admin_log;
     /* constructor */
     // Do an auto-update on the variable used to hook parsers - so we should only be called once
     e107::lan('linkwords', e_LANGUAGE);
     // e_PLUGIN."linkwords/languages/".e_LANGUAGE.".php"
     $hooks = explode(",", $pref['tohtml_hook']);
     if (($key = array_search('linkwords', $hooks)) !== FALSE) {
         unset($hooks[$key]);
     }
     if (count($hooks) == 0) {
         unset($pref['tohtml_hook']);
     } else {
         $pref['tohtml_hook'] = implode(',', $hooks);
     }
     if (!isset($pref['e_tohtml_list'])) {
         $pref['e_tohtml_list'] = array();
     }
     if (!in_array('linkwords', $pref['e_tohtml_list'])) {
         $pref['e_tohtml_list'][] = 'linkwords';
     }
     save_prefs();
     e107::getLog()->add('LINKWD_05', LWLAN_58 . '[!br!]' . $pref['tohtml_hook'], '');
     // Log that the update was done
     return;
 }
开发者ID:armpit,项目名称:e107,代码行数:27,代码来源:linkwords.php

示例9: iconpicker_shortcode

function iconpicker_shortcode($parm)
{
    $parms = array();
    parse_str($parm, $parms);
    $name = varset($parms['id']);
    $sql = e107::getDb();
    $frm = e107::getForm();
    $tp = e107::getParser();
    // $sc_parameters is currently being used to select the media-category.
    $qry = "SELECT * FROM `#core_media` WHERE media_userclass IN (" . USERCLASS_LIST . ") ";
    $qry .= vartrue($sc_parameters) ? " AND media_category = '" . $sc_parameters . "' " : " AND `media_category` REGEXP '_icon_16|_icon_32|_icon_48|_icon_64' ";
    $qry .= "ORDER BY media_category,media_name";
    $str = "";
    $size_section = array();
    $lastsize = "16";
    if ($sql->db_Select_gen($qry)) {
        while ($row = $sql->db_Fetch()) {
            list($tmp, $tmp2, $size) = explode("_", $row['media_category']);
            if ($str != '' && $size != $lastsize) {
                $size_section[] = $str;
                $str = "";
            }
            $str .= "<a href='#" . $row['media_url'] . "' title='{$filepath}' onclick=\"e107Helper.insertText('{$row['media_url']}','{$name}','{$name}-iconpicker'); return false; \"><img class='icon picker list%%size%%' src='" . $tp->replaceConstants($row['media_url'], 'abs') . "' alt='{$row['media_name']}' /></a>";
            $lastsize = $size;
        }
        return '<div id="' . $name . '-iconpicker-ajax"><div class="field-spacer iconpicker">' . str_replace('%%size%%', '', implode('</div><div class="field-spacer iconpicker">', $size_section)) . '</div></div>';
    }
}
开发者ID:armpit,项目名称:e107,代码行数:28,代码来源:iconpicker.php

示例10: user_avatar_shortcode

function user_avatar_shortcode($parm = '')
{
    global $loop_uid;
    $height = e107::getPref("im_height");
    $width = e107::getPref("im_width");
    $tp = e107::getParser();
    if (intval($loop_uid) > 0 && trim($parm) == "") {
        $parm = $loop_uid;
    }
    if (is_numeric($parm)) {
        if ($parm == USERID) {
            $image = USERIMAGE;
        } else {
            $row = get_user_data(intval($parm));
            $image = $row['user_image'];
        }
    } elseif ($parm) {
        $image = $parm;
    } elseif (USERIMAGE) {
        $image = USERIMAGE;
    } else {
        $image = "";
    }
    if (vartrue($image)) {
        $img = strpos($image, "://") !== false ? $image : $tp->thumbUrl(e_MEDIA . "avatars/" . $image, "aw=" . $width . "&ah=" . $height);
        $text = "<img class='user-avatar e-tip' src='" . $img . "' alt='' style='width:" . $width . "px; height:" . $height . "px' />\n\t\t";
    } else {
        $img = $tp->thumbUrl(e_IMAGE . "generic/blank_avatar.jpg", "aw=" . $width . "&ah=" . $height);
        $text = "<img class='user-avatar' src='" . $img . "' alt='' />";
    }
    return $text;
}
开发者ID:notzen,项目名称:e107,代码行数:32,代码来源:user_avatar.php

示例11: getListData

 function getListData()
 {
     $sql = e107::getDb();
     $list_caption = $this->parent->settings['caption'];
     $list_display = $this->parent->settings['open'] ? "" : "none";
     $qry = '';
     if ($this->parent->mode == "new_page" || $this->parent->mode == "new_menu") {
         $qry = "user_join>" . $this->parent->getlvisit() . " AND ";
     }
     $qry .= " user_ban=0 ORDER BY user_join DESC LIMIT 0," . intval($this->parent->settings['amount']);
     $bullet = $this->parent->getBullet($this->parent->settings['icon']);
     if (!$this->parent->e107->sql->gen("SELECT user_id,user_name,user_join FROM #user WHERE " . $qry)) {
         $list_data = LIST_MEMBER_2;
     } else {
         while ($row = $this->parent->e107->sql->fetch()) {
             $record = array();
             $rowheading = $this->parent->parse_heading($row['user_name']);
             //<a href='".e_BASE."user.php?id.".$row['user_id']."'>".$rowheading."</a>
             $uparams = array('id' => $row['user_id'], 'name' => $rowheading);
             $link = e107::getUrl()->create('user/profile/view', $uparams);
             $userlink = "<a href='" . $link . "'>" . $rowheading . "</a>";
             $record['icon'] = $bullet;
             $record['heading'] = USER ? $userlink : $rowheading;
             $record['category'] = '';
             $record['author'] = '';
             $record['date'] = vartrue($this->parent->settings['date']) ? $this->parent->getListDate($row['user_join']) : "";
             $record['info'] = '';
             $list_data[] = $record;
         }
     }
     //return array with 'records', (global)'caption', 'display'
     return array('records' => $list_data, 'caption' => $list_caption, 'display' => $list_display);
 }
开发者ID:KonzolozZ,项目名称:e107,代码行数:33,代码来源:list_members.php

示例12: showForm

 public function showForm($mes)
 {
     $ns = e107::getRender();
     $frm = new form();
     $text = $frm->form_open('post', e_SELF);
     $text .= "<table class='table adminform'>";
     $text .= "<tr><td>" . LAN_RADIUS_01 . "</td><td>";
     $text .= $frm->form_text('radius_server', 35, vartrue($this->radius['radius_server']), 120);
     $text .= "</td></tr>\n";
     $text .= "<tr><td>" . LAN_RADIUS_02 . "</td><td>";
     $text .= $frm->form_text('radius_secret', 35, vartrue($this->radius['radius_secret']), 200);
     $text .= "</td></tr>\n";
     $tmp = $this->alt_auth_get_field_list('radius', $frm, $this->radius, FALSE);
     if ($tmp) {
         $text .= "<tr><td class='forumheader2' colspan='2'>" . LAN_ALT_27 . "</td></tr>\n" . $tmp;
         unset($tmp);
     }
     $text .= "<tr><td class='forumheader' colspan='2' style='text-align:center;'>";
     // $text .= $frm -> form_button("submit", "update", LAN_ALT_2);
     $text .= e107::getForm()->admin_button('update', LAN_UPDATE, 'update');
     $text .= "</td></tr>\n";
     $text .= "</table>\n";
     $text .= $frm->form_close();
     $ns->tablerender(LAN_RADIUS_06, $mes->render() . $text);
     $ns->tablerender(LAN_ALT_40 . LAN_ALT_41, $this->alt_auth_test_form('radius', $frm));
 }
开发者ID:armpit,项目名称:e107,代码行数:26,代码来源:radius_conf.php

示例13: renderMenu

 /**
  * Render menu.
  */
 function renderMenu()
 {
     $tpl = e107::getTemplate('nodejs_comment');
     $sc = e107::getScBatch('nodejs_comment', true);
     $tp = e107::getParser();
     $cm = e107::getComment();
     $amount = (int) vartrue($this->plugPrefs['comment_display'], 10);
     /**
      * getCommentData() returns with array, which contains:
      * - comment_datestamp
      * - comment_author_id
      * - comment_author
      * - comment_comment
      * - comment_subject
      * - comment_type
      * - comment_title
      * - comment_url
      */
     $items = $cm->getCommentData($amount);
     $text = $tp->parseTemplate($tpl['MENU']['LATEST']['HEADER'], true, $sc);
     foreach ($items as $item) {
         $sc->setVars($item);
         $text .= $tp->parseTemplate($tpl['MENU']['LATEST']['ITEM'], true, $sc);
     }
     if (empty($items)) {
         $text .= '<a href="#" class="list-group-item no-posts text-center">' . LAN_PLUGIN_NODEJS_COMMENT_FRONT_05 . '</a>';
     }
     $text .= $tp->parseTemplate($tpl['MENU']['LATEST']['FOOTER'], true, $sc);
     e107::getRender()->tablerender(LAN_PLUGIN_NODEJS_COMMENT_FRONT_04, $text);
     unset($text);
 }
开发者ID:lonalore,项目名称:nodejs_comment,代码行数:34,代码来源:nodejs_comment_latest_menu.php

示例14: install_post

 function install_post($var)
 {
     e107::includeLan(e_PLUGIN . 'featurebox/languages/' . e_LANGUAGE . '_admin_featurebox.php');
     $mes = e107::getMessage();
     $query = array();
     $query['fb_category_id'] = 0;
     $query['fb_category_title'] = 'General';
     $query['fb_category_template'] = 'default';
     $query['fb_category_random'] = 0;
     $query['fb_category_class'] = e_UC_PUBLIC;
     $query['fb_category_limit'] = 1;
     $inserted = e107::getDb()->db_Insert('featurebox_category', $query);
     $status = $inserted ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
     $mes->add(FBLAN_INSTALL_01, $status);
     if ($inserted) {
         $query = array();
         $query['fb_id'] = 0;
         $query['fb_category'] = $inserted;
         $query['fb_title'] = 'Default Title';
         $query['fb_text'] = 'Default Message';
         $query['fb_mode'] = 0;
         $query['fb_class'] = e_UC_PUBLIC;
         $query['fb_rendertype'] = 0;
         $query['fb_template'] = 'default';
         $query['fb_order'] = 0;
         $query['fb_image'] = '';
         $query['fb_imageurl'] = '';
         $status = e107::getDb('sql2')->db_Insert('featurebox', $query) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
     } else {
         $status = E_MESSAGE_ERROR;
     }
     $mes->add(FBLAN_INSTALL_02, $status);
 }
开发者ID:notzen,项目名称:e107,代码行数:33,代码来源:featurebox_setup.php

示例15: getListData

 function getListData()
 {
     $sql = e107::getDb();
     $tp = e107::getParser();
     $list_caption = $this->parent->settings['caption'];
     $list_display = $this->parent->settings['open'] ? "" : "none";
     if ($this->parent->mode == "new_page" || $this->parent->mode == "new_menu") {
         $lvisit = $this->parent->getlvisit();
         $qry = "cb_datestamp>" . $lvisit;
     } else {
         $qry = "cb_id != '0' ";
     }
     $qry .= " ORDER BY cb_datestamp DESC LIMIT 0," . intval($this->parent->settings['amount']);
     $bullet = $this->parent->getBullet($this->parent->settings['icon']);
     if (!($chatbox_posts = $this->parent->e107->sql->gen("SELECT * FROM #chatbox WHERE " . $qry))) {
         $list_data = LIST_CHATBOX_2;
     } else {
         while ($row = $this->parent->e107->sql->fetch()) {
             $cb_id = substr($row['cb_nick'], 0, strpos($row['cb_nick'], "."));
             $cb_nick = substr($row['cb_nick'], strpos($row['cb_nick'], ".") + 1);
             $cb_message = $row['cb_blocked'] ? CHATBOX_L6 : str_replace("<br />", " ", $tp->toHTML($row['cb_message']));
             $rowheading = $this->parent->parse_heading($cb_message);
             $record['icon'] = $bullet;
             $record['heading'] = $rowheading;
             $record['author'] = $this->parent->settings['author'] ? $cb_id != 0 ? "<a href='" . e_BASE . "user.php?id.{$cb_id}'>" . $cb_nick . "</a>" : $cb_nick : "";
             $record['category'] = "";
             $record['date'] = $this->parent->settings['date'] ? $row['cb_datestamp'] ? $this->parent->getListDate($row['cb_datestamp']) : "" : "";
             $record['info'] = "";
             $list_data[] = $record;
         }
     }
     //return array with 'records', (global)'caption', 'display'
     return array('records' => $list_data, 'caption' => $list_caption, 'display' => $list_display);
 }
开发者ID:armpit,项目名称:e107,代码行数:34,代码来源:e_list.php


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