Emlog Template Authoring Help manual

Source: Internet
Author: User
Tags php foreach

Emlog Basic template file must file: Main.css:CSS (style sheet) file log_list.php: Log List page template echo_log.php: Log page Template page.php: page template footer.php: Footer Template Header.php:Header template t.php: Broken language template module.php: include widgets, comments, references, edits, and other optional files: side.php: Sidebar template basic condition Judgment tag$curpage: Current page representation , commonly used to determine the tag as follows: $curpage = = Curpage_home: Home $curpage = = curpage_tw: Broken language page $curpage = = curpage_log: Log, page page role: Current visitor identity role = = ' Admin ': admin role = = ' writer ': co-author role = = ' Vistor ': User not logged in

  

Template php Tag description generic: <?php if (!defined (' Emlog_root ')) {exit (' error! ');}?> there is a header for each PHP file to prevent unauthorized access to <?php include Getviews ( ' XXXX '); : Call the current template directory under Xxxx.php file <?php echo emlog_version;? Display the current Emlog version <?php echo template_url;: Display template file path <?php echo blog_url;?: Show Blog url<?php echo $ Blogtitle;: Displays the blog title (will vary according to the current page) <?php Echo $blogname;: Show blog name <?php Echo $bloginfo;: Show Blog Description <?php echo $ICP;: Display record number <?php Endforeach;: Loop end, Need and <?php foreach (xxxx):?> pairing <?php endif;? : End If tag, required and <?php if (xxxx):?> pairing header.php<?php/*template Name: Template Name Description: Template Description Author: template author author Url: Author Home sidebar Amount: Number of Sidebar, maximum 4*/?> template comment, present in header.php header, nullable <?php doAction (' NavBar ', ' left label ', ' right label ');?> : Plug-in mount point, used for navigation bar, left and right tag as HTML tag, to control style, can be empty <?php if ($istwitter = = ' Y '):?: If background setting foreground visible broken link <?phpforeach ($navibar as $ Key = $val): if ($val [' hide '] = = ' Y ') {continue;} if (Empty ($val [' url '])) {$val [' url '] = Blog_url. '? Post= '. $key;}? Start navigation loop footer.php<?php doAction (' Index_footer ');: Plug-in Mount point (for statistical Code, etc.) echo_log.php<?php TOPFLG ($top);.: Top flag, function exists in module.php<?php Echo $log _title;: Display log, page title <?php echo $log _content;: Display log contents <?php blog_sort ($sortid, $logid);?> : Displays the classification, which exists in module.php<?php EDITFLG ($logid, $author);.: Show edit link, function exists in module.php<?php blog_author ($author) ;: Show log author, function exists in module.php<?php echo gmdate (' Y-n-j g:i l ', $date);.: Log publish time in 2010-12-11 19:05 30, format modifiable < ? PHP Blog_att ($logid);: Show log attachments (picture attachments not shown), functions exist in module.php<?php Blog_tag ($logid);.: Show Log labels, function exists in module.php<?php doAction (' log_related ');: Plug-in Mount point (for related logs, etc.) <?php neighbor_log ();.: Show adjacent logs, function exists in module.php<?php blog_trackback ();: Display trackback address and reference, function exists in module.php<?php blog_comments ();.: Show Log comments, The function exists in module.php<?php if ($allow _remark = = ' Y ') {blog_comments_post ();}? : Based on whether comments are allowed to display a comment form, the function exists in module.phppage.php<?php echo $log _title;: Display log, page title <?php echo $log _content;? Display log contents <?php Blog_att ($logid);: Display attachment (image attachment not shown), function exists in module.php<?php if ($allow _remark = = ' Y ') {blog_comments (); Blog_comments_post () ;} : Based on whether comments are allowed to display comments and comment forms, functions exist in module.phplog_list.php<?php doAction (' index_loglist_top ');.: Plug-in Mount point, exists at the top of the list (for announcements, etc.) <?php foreach ($logs as $value): Start loop output Log list---------------------------------The following only exists in <?php foreach ($logs as $value):?> and <?php Endforeach,?> <?php topflg ($value [' top ']); function exists in module.php<?php echo $value [' Log_title '];: Display log title <?php echo $value [' log_description '];: Display log summary <?php blog_sort ($value [' SortID '], $value [' Logid ']);: Display classification, the function exists in module.php<?php EDITFLG ($value [' Logid '] , $value [' author ']);: Show edit link, function exists in module.php<?php blog_author ($value [' author ']);: Show log author, The function exists in module.php<?php echo gmdate (' Y-n-j g:i l ', $value [' Date ']);.: Log publish time, format is 2010-12-11 19:05 30, format can be modified by itself <? PHP Blog_att ($value [' logid ']);: Display log attachments (image attachments do not appear), functions exist in module.php<?php blog_tag ($value [' logid ']);?> : Show Log Labels, the function exists in module.php<?php echo $value [' Comnum '];: Comment number <?php echo $value [' tbcount '];?: Reference <?php echo $ value[' views ';: Browse count----------------------------------only exists in <?php foreach ($logs as $value):?> and <?php Endforeach,?> between <?php echo $page _url;? : Show paging side.php<?php $widgets =!empty ($options _cache[' widgetsx ')? Unserialize ($options _cache[' widgetsx '): Array ();?: the page to load the widgets,x is a number, not more than the number of sidebar set in header.php <?php DoAction (' Diff_side ');: Plug-in Mount point <?phpforeach ($widgets as $val) {$widget _title = @unserialize ($options _cache[' Widget_title ']); $custom _widget = @unserialize ($options _cache[' custom_widget ')); if (Strpos ($val, ' custom_wg_ ') = = = = 0) {$callback = ' widget_custom_text ', if (function_exists ($callback)) {Call_user_func ($callback, Htmlspecialchars ($ custom_widget[$val [' title ']), $custom _widget[$val] [' content '], $val);}} else{$callback = ' widget_ ' $val, if (function_exists ($callback)) {Preg_match ("/^.*\s\ ((. *) \)/", $widget _title[$val], $MATCHS); $wgTitle = iSset ($matchs [1])? $matchs [1]: $widget _title[$val];call_user_func ($callback, Htmlspecialchars ($wgTitle));}}? This long string is used to display widgetsmodule.php (recommended for reference in the default template) function Widget_xxxx ($title): Displays widgets functions, such as Widget_blogger ($title) Show blogger Information T.php<?phpforeach ($tws as $val): $author = $user _cache[$val [' author ']][' name ']; $avatar = Empty ($user _cache[$ val[' author ']][' Avatar ')? Blog_url. ' admin/views/'. Admin_tpl. '/images/avatar.jpg ': Blog_url. $user _cache[$val [' Author ']][' Avatar ']; $tid = (int) $val [' id '];? Start looping output broken language <?php echo $author;.: Display the <?php echo $val [' t '] of the broken language publisher; : Display <?php echo $pageurl;? Show Broken Words page <?php echo $twnum;.: Displays the number of broken words

  

Emlog Template Authoring Help manual

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.