Home > Backend Development > PHP Tutorial > Liuku Community Forum HOME page fresh style free version download_PHP tutorial

Liuku Community Forum HOME page fresh style free version download_PHP tutorial

WBOY
Release: 2016-07-21 15:57:31
Original
984 people have browsed it

All are made with DIV+CSS, and the call is made by directly reading the database, which is very fast and automatically generates static HTML pages. Color can be controlled through CSS to adjust the color to match your forum! You can also use the included HOME program to create your own HOME page in the style you like! As long as you are willing to do it, you can create a colorful forum homepage!
================================================== ============================
Design and production: Yuan Yisu
Contact information: QQ: 11881448
Professional Website design and production, forum HOME production and design, style design.
Support community: Six Cool Community
Website: http://www.6co.cn
Liuku Community Forum HOME page fresh style free version download_PHP tutorial Download this file
================ ================================================== ==========
Please use this style to retain the style copyright, thank you. If you don't mind, you can give us a link. Oh! ~
Second floor update

If you have any questions, please go to
http://www.6co.cn/forumdisplay.php?fid=129
Ask it

Please support us The community

Liuku Community http://www.6co.cn

often visit our community. I will publish some plug-ins, styles and styles in the style plug-in section of the community from time to time. Color matching!

========================================= ====

How to modify style

1. Modification of templates
Just modify the templates/default/cohome.htm file

------- ------------------------------------------------------------------------------------------

2. Add a slideshow image Method:
Open the topview.js file in the picture directory,
var pics= is followed by the picture address, separated by commas.
var links=Followed by the link address
var texts=Followed by the file to be displayed
Pictures, links, and names are all in one-to-one correspondence.

———————————————————————————————————————————————————————— -

3. The following method for adding scrolling pictures:
Just use dw to open the pichome.htm file in the root directory and modify it.

—————————————————————————————————————————————————————— -

Forum content call:
Modify the home.php file in the root directory
========================== ================

4. Small section calling instructions:

Copy code Code As follows:

$shipingtpmain = '';
$query = $db->query("SELECT t . fid , f . fup , f . name ,t.author,t. views, t . tid , t . subject ,t . dateline FROM {$tablepre}threads t LEFT JOIN {$tablepre}forums f ON f . fid =t . fid where t . fid =1 ORDER BY `t` . `dateline ` DESC LIMIT 0, 16");
while($shipingtp = $db->fetch_array($query)) {
$shipingtp[subject]=cutstr($shipingtp[subject],26);
$times=gmdate("$dateformat ", $shipingtp[dateline] + $timeoffset * 3600);
$shipingtpmain.="
table>";
}

$shipingtp[subject] The $shipingtp in front of this is the variable name. The variable name of each call cannot be the same. When changing the variable in this code The names must be the same, and if there is one difference, they cannot be called.
fid =1 The number after this is the FID value of the section
DESC LIMIT 0, 16"); the 16 after this is the number of calls
($shipingtp[subject],26); the number after this 26 is the number of displayed words
. After setting it, just insert $ variable name + main at the corresponding position in the template. Example: $shipingtpmain
The effect of calling: It’s really evil! Feng Xiaogang and Xu Fan’s early passionate couple

------------------------------------------------------------

5. Classification call instructions:
Code:


Copy code The code is as follows:

//IT数码 
$itshuomamain = ''; 
$query = $db->query("SELECT t . fid , f . fup , f . name ,t.author,t.views, t . tid , t . subject ,t . dateline FROM {$tablepre}threads t LEFT JOIN {$tablepre}forums f ON f . fid =t . fid where f . fup =21 ORDER BY `t` . `dateline`  DESC LIMIT 0, 10"); 
while($itshuoma = $db->fetch_array($query)) { 
    $itshuoma[subject]=cutstr($itshuoma[subject],30); 
    $itshuomamain.="
$shipingtp[subject]
【$itshuoma[name]】$itshuoma[subject]
"; 

$itshuoma[subject]这前面的$itshuoma是变量名,每条调用的变量名都不能相同,改的时候这一段代码中的变量名都要一样,有一个不同就调用不出来。
fup =21这后面的数是大版块的FID值
DESC LIMIT 0, 10");这后面的10是调用条数
($itshuoma[subject],30);这后面的30是显示字数
设置好后在模板中的相应位置只要插入$变量名+main  例:$itshuomamain
调用出来的效果:【电脑病毒】2006年世界最新杀毒软件排名
如果不想要【电脑病毒】这样的版块出标题前面只要把【$itshuoma[name]】这句删除就行

---------------------------------------------

6、会员发贴排行调用:
代码
//发贴总排行
复制代码 代码如下:

$hotmember1 = ''; 
$query = $db->query("SELECT username, uid, posts FROM {$tablepre}members ORDER BY posts DESC LIMIT 0, 10"); 
while($member = $db->fetch_array($query)) { 
       $hotmember1.=" 
  
  
$member[username]
$member[posts]
"; 
           } 
$hotmember1调用变量名
DESC LIMIT 0, 10");后面的10为调用条数

---------------------------------------------


7、论坛精华贴调用:
代码
复制代码 代码如下:

//Community Highlights TOP
$jingthreads = '';
$query = $db->query("SELECT * FROM {$tablepre}threads t LEFT JOIN {$tablepre}forums f ON f . fid =t . fid where digest ORDER BY `t` . `lastpost` DESC LIMIT 0, 7");
while($thread = $db->fetch_array($query)) {
       $thread[subject] = cutstr($thread[subject], 35); >·$thread[subject]
" ;
}

$jingthreads call variable name
DESC LIMIT 0, 7"); the following 7 is the number of calls
($thread[subject], 35); the following 35 is the number of displayed characters

————————————————————————————————————————————————————————————————————

8. Call the latest forum post:
Code


Copy code The code is as follows:
/ /Latest articles
$replythreads = '';
$query = $db->query("SELECT author, views, tid, subject, lastpost FROM {$tablepre}threads ORDER BY dateline DESC LIMIT 0, 10 ");
while($thread = $db->fetch_array($query)) {
$thread[subject] = cutstr($thread[subject], 27);
$thread[lastpost ] = gmdate("Y-m-j g:i", $thread[lastpost] + $timeoffset * 3600);
$replythreads.="
  • $thread[subject]
    ";
    }

  • $replythreads call variable name
    DESC LIMIT 0, 10"); the following 10 is the number of calls
    ($thread[subject], 27); the following 27 is the number of displayed characters

    ————————————————————————————————————————————————————————

    9. Friendly link call
    code


    Copy code The code is as follows:

    $tightlink_text = $tightlink_logo = ''; 
    $query = $db->query("SELECT * FROM {$tablepre}forumlinks ORDER BY displayorder"); 
                            while($flink = $db->fetch_array($query)) { 
                                    if($flink['note']) { 
                                            if($flink['logo']) { 
                                                    $forumlink['type'] = 1; 
                                                    $forumlink['logo'] = $flink['logo']; 
                                            } else { 
                                                    $forumlink['type'] = 2; 
                                            } 
                                            $data[] = $forumlink; 
                                    } else { 
                                            if($flink['logo']) { 
                                                    $tightlink_logo .= "target="_blank" class='mainlink1'>Liuku Community Forum HOME page fresh style free version download_PHP tutorial[name]"  alt="$flink[content]"> "; 
                                            } else { 
                                                    $tightlink_text .= "target="_blank" class='mainlink1'>[$flink[name]] "; 
                                            }
    } }
    If ($ Tightlink_logo || $ Tightlink_text) {
    $ Tightlink_logo. = $ Tightlink_logo? '& LT; br & gt;': ''; $ Data [] = Array ('type' => 3, 'content' =>
    $tightlink_logo.$tightlink_text);

    $flink[content] is a text link calling variable
    Both should be present at the same time
    --------------------- -------------------------
    12. How to generate a static HTML page
    Open main.php
    and search for:



    Copy code

    The code is as follows:
    /*$discuz_action = 1; Replace all the above codes (excluding this sentence) For
    [Copy to clipboard] [ - ]CODE:

    if(file_exists("main.html"))
    {
    $time=time() ;
    //If the file modification time is different from the current time?, direct to the html file, otherwise regenerate the html
    if($time-filemtime("main.html"){
    header("Location:main.html");
    }
    }
    //Add ob_start() at your beginning;
    ob_start();

    define ('CURRSCRIPT', 'main');

    require './include/common.inc.php';
    require DISCUZ_ROOT.'./include/forum.func.php';

    Find




    Copy code

    The code is as follows:
    include template('bbs_all'); Replace all the codes below (excluding this sentence) with



    Copy the code

    The code is as follows:
    //Add ob_end_clean() at the end and output this page to a variable $temp=ob_get_contents(); ob_end_clean();
    // Write file
    $fp=fopen('main.html','w');
    fwrite($fp,$temp) or die('Write file error');
    //echo" HTML generation completed! ";
    header("Location:main.html");
    ?>

    On the contrary, the static HTML page will not be generated



    http://www.bkjia.com/PHPjc/317841.html
    www.bkjia.com

    truehttp: //www.bkjia.com/PHPjc/317841.htmlTechArticle are all made with DIV+CSS. The call uses direct reading of the database, which is very fast and automatically generates static HTML. Page. Color can be controlled through CSS to adjust the color to match your forum! Also...
    source:php.cn
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Popular Recommendations
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template