search
HomeBackend DevelopmentPHP TutorialFour grids on the homepage, five grids on the homepage For6.0 (GBK) (UTF-8) [12 combinations] [9-18] [Moderator installation test passed]_PHP tutorial

Four-frame homepage, five-frame homepage downloaded 10,000 times For6.0 (GBK) (UTF-8) [12 combinations] [9-18] [Moderator installation test passed]
Quote:
This plug-in is provided by Moderator sakurakawaii tested the installation under Windows XP Discuz! 6.0.0 standard template IE6 Mysql4.1 at 15:30 on September 8, 2007.
This test only means that the plug-in is installed without errors. Including references to problems that may arise in long-term use in the future:
Statement: This program quotes part of the 5.0 four-frame code. If the source code author has any comments, please message me and I will delete it and publish it!
After extensive modifications and flash settings added With a lot of custom settings, this plug-in can be said to be the most comprehensive and beautiful one in the forum! Congratulations on this plug-in passing the moderator test!

Update list and plug-in advantages:

9-18: Add six grids to the homepage at the request of friends (pictures + new posts + replies + popular this week + highlights of this month + today’s rankings) please go to Download the attachment package at the bottom
9-15: Updated the problem that a few friends’ servers do not support =$show?>, resulting in pictures not being displayed. (Just download the package directly and overwrite pic.php)
9-13: At the request of forum friends, we added a four-frame call combination with the number of days to build the website without pictures! (See the demo at the bottom of the attachment)
9-10: Add the UTF-8 version of four and five grids that is rare in the forum. Please download and use it! (See the bottom of the attachment)
9-9 8:00 Update:
Quote:
Fixed the problem of line wrapping of post titles in all combinations when the screen resolution is small or columns are turned on!
9-8 14:00
In response to requests from friends, the four-frame style has been newly changed. There are currently seven calling methods (see attachment).
In response to everyone's request, the following two combinations have been added (already released)
1. Pictures, new posts, latest replies, popular this week, ranking of today's posts (five boxes on the homepage)
2. New posts, Latest replies, hot topics this week, highlights
9-7: Solved the problem of sensitive words still being displayed in four boxes after filtering!
9-6: Breakthrough: Changed the previous flash style, changed the text below It is beautiful and solves the problem of picture card and flash calling raised by many friends! Now it is very fast, and you can customize the buttons, text, background color and background transparency in flash. It is truly user-friendly and meets your requirements for matching forum style and color!
9-6: Special update: When the forum opens the theme recycle bin, there will no longer be a situation where posts are still displayed in four spaces on the homepage after being placed in the theme recycle bin. !

Comments on various parameters that can be set by yourself (in view of the fact that many friends do not know the setting method, all the content that can be set is written below for everyone’s use)
1/3: pic .php

Copy code The code is as follows:
$shownums = 5;//The number of demonstrations is within 6
$searchnums = 50;//Total number of searches.
$cachelife = 1800;//Cache time.
$orderby = 'dateline';//Search order: by date dateline. By number of views downloads. Random rand.
$cachename = 'showpic';//Cache name. If it conflicts with any plug-in, please modify it. As long as there is no conflict, it will not affect the use.
$searchfid = '';//Search fid range. Leave blank without restriction. .Please separate them with commas, such as '1,2,3'.

var config='5|0xffffff|0x0099ff|50|0xffffff|0x0099ff|0x000000'
//-- config parameters -- Auto play time (seconds)|Text color|Text background color|Text background transparency|Button number color|Current button color|Normal button color
var swf_width=255 Set flash width
var swf_height=175 Set flash height 2 /3

In index.php, copy the code

in
. The code is as follows:

$hack_cut_str = 26; //Number of title words
DESC LIMIT 0, 10" //Set the number of displayed items

If you don’t want to call a certain version or a certain area or a certain version of posts, you can Add the space reserved for everyone in index.php: (three places in total)
and f.fid not in (0)
is added to:
and f.fid not in (1,2,3 ) Among them, 123 is the fid that you don’t want to call,
or you just want to call 1 2 3. Change it to: and f.fid in (1,2,3)3/3: discuz.htm quoted:
If you want to When the link in the latest reply opens, it will point to the location of the last reply to this post. Just copy the code in discuz.htm:

The code is as follows:

changed to:

Copy code The code is as follows:


If you need to add the telescopic click function to each area like the official one, please rewrite it in discuz.htm (five boxes, if it is four boxes, please follow
Copy code The code is as follows:

< ;h3>Post today




is:
Copy code The code is as follows:


Collapse/Expand
> ;

Today’s post







Demonstration picture: (New style written according to requirements, making it more complete among the six official styles...)
Four grids on the homepage, five grids on the homepage For6.0 (GBK) (UTF-8) [12 combinations] [9-18] [Moderator installation test passed]_PHP tutorial
Use The files that need to be added to this plug-in are:

pic.php //Calling the forum image data,
list.gif and listbg.gif //The picture in the title
focus.swf / /Call the flash of the image [This swf is very different from the previous one, I personally think it is better]
The files that need to be modified are:

index.php
discuz.htm
======================= Start adding and modifying ======================= =====
Steps: 4 steps in total

Transfer pic.php / list.gif / listbg.gif / focus.swf to FTP (website) according to the downloaded attachment structure )
Among them: pic.php in the forum root directory
list.gif / listbg.gif / focus.swf in the images folder
Open index.php
Search:
Copy code The code is as follows:

$rsshead = $rssstatus

Add above:
Copy code The code is as follows:

//----首页四格代码开始
$colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
//新贴
$hack_cut_str = 26; //标题字数
$hack_cut_strauthor = 9;
$new_post_threadlist = array();
$nthread = array();
$query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid'$fid' AND f.fid=t.fid AND f.fid not in (0) AND t.displayorder not in (-1,-2) ORDER BY t.dateline DESC LIMIT 0, 10");
while($nthread = $db->fetch_array($query)) {
        $nthread['forumname'] = ereg_replace(']*>','',$nthread['name']);
        $nthread['view_subject'] = cutstr($nthread['subject'],$hack_cut_str);
        $nthread['view_author'] = cutstr($nthread['author'],$hack_cut_strauthor);
        $nthread['date']= gmdate("$dateformat $timeformat", $nthread['dateline'] + $timeoffset * 3600);
        $nthread['lastreplytime']= gmdate("$dateformat $timeformat", $nthread[lastpost] + ($timeoffset * 3600));
        if($nthread['highlight']) {
                $string = sprintf('%02d', $nthread['highlight']);
                $stylestr = sprintf('%03b', $string[0]);
                $nthread['highlight'] = 'style="';
                $nthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
                $nthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
                $nthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
                $nthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
                $nthread['highlight'] .= '"';
        } else {
                $nthread['highlight'] = '';
        }
        $new_post_threadlist[] = $nthread;
}
//新回复
$hack_cut_str = 26; //标题字数
$hack_cut_strauthor = 9;
$new_reply_threadlist = array();
$rthread = array();
$query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid'$fid' AND f.fid=t.fid  AND t.closed NOT LIKE 'moved|%' AND t.replies !=0 AND f.fid not in (0) AND t.displayorder not in (-1,-2) ORDER BY t.lastpost DESC LIMIT 0, 10");
while($rthread = $db->fetch_array($query)) {
        $rthread['forumname'] = ereg_replace(']*>','',$rthread['name']);
        $rthread['view_subject'] = cutstr($rthread['subject'],$hack_cut_str);
        $rthread['view_lastposter'] = cutstr($rthread['lastposter'],$hack_cut_strauthor);
  $rthread['date']= gmdate("$dateformat $timeformat", $rthread['dateline'] + $timeoffset * 3600);
        $rthread['lastreplytime']= gmdate("$dateformat $timeformat", $rthread[lastpost] + ($timeoffset * 3600));
        if($rthread['highlight']) {
                $string = sprintf('%02d', $rthread['highlight']);
                $stylestr = sprintf('%03b', $string[0]);
                $rthread['highlight'] = 'style="';
                $rthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
                $rthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
                $rthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
                $rthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
                $rthread['highlight'] .= '"';
        } else {
                $rthread['highlight'] = '';
        }
        $new_reply_threadlist[] = $rthread;
}
//热帖
$hack_cut_str = 26; //标题字数
$hack_cut_strauthor = 9;
$new_hot_threadlist = array();
$mthread = array();
$ctime=$timestamp-3600*24*7;//最后7是天数为本周  
$query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid'$fid' AND f.fid=t.fid  AND t.closed NOT LIKE 'moved|%' AND t.replies !=0 AND t.dateline>$ctime AND f.fid not in (0) AND t.displayorder not in (-1,-2) ORDER BY t.replies DESC LIMIT 0, 10");
while($mthread = $db->fetch_array($query)) {
        $mthread['forumname'] = ereg_replace(']*>','',$mthread['name']);
        $mthread['view_subject'] = cutstr($mthread['subject'],$hack_cut_str);
        $mthread['view_lastposter'] = cutstr($mthread['lastposter'],$hack_cut_strauthor);
  $mthread['date']= gmdate("$dateformat $timeformat", $mthread['dateline'] + $timeoffset * 3600);
        $mthread['lastreplytime']= gmdate("$dateformat $timeformat", $mthread[lastpost] + ($timeoffset * 3600));
        if($mthread['highlight']) {
                $string = sprintf('%02d', $mthread['highlight']);
                $stylestr = sprintf('%03b', $string[0]);
                $mthread['highlight'] = 'style="';
                $mthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
                $mthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
                $mthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
                $mthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
                $mthread['highlight'] .= '"';
        } else {
                $mthread['highlight'] = '';
        }
        $new_hot_threadlist[] = $mthread;
}
//----首页四格代码结束

打开 templates/default/discuz.htm 
查找:
复制代码 代码如下:



复制代码 代码如下:




  
  
   
   
   
   
  
  
  
   
   
   
   
  

≡ 论坛图片 ≡

≡ 最新帖子 ≡

≡ 最新回复 ≡

≡ 本周热门 ≡


    <script></script>
   

    
     
      
      
     
    
Four grids on the homepage, five grids on the homepage For6.0 (GBK) (UTF-8) [12 combinations] [9-18] [Moderator installation test passed]_PHP tutorial
      
       
        
                   
        
       
      
      

   

    
     
      
      
     
    
Four grids on the homepage, five grids on the homepage For6.0 (GBK) (UTF-8) [12 combinations] [9-18] [Moderator installation test passed]_PHP tutorial
      
       
      
      

   

    
     
      
      
     
    
Four grids on the homepage, five grids on the homepage For6.0 (GBK) (UTF-8) [12 combinations] [9-18] [Moderator installation test passed]_PHP tutorial
      
       
      
      

   




Upload the index.php and discuz.htm you just modified
================================ ==========================================
If you have not modified These two files can be downloaded as attachments (please note: 0904 latest 6.0.0 official version) and can be overwritten directly!
====================== ================================================== ===
Each package in the attachment is independent. Please download it according to your favorites and versions and upload it directly to use. No database settings are required!
Finally: Please remember to overwrite or rewrite the file each time Be sure to update the cache later!

Please support another original plug-in of mine: all songs in the forum music area [picture]
Please install it and leave your website address! If you can, please rate it! Thank you!
I hope you all like it!
Wow, after the update, I deleted the number of downloads. It was originally about 5,000 times!
All files packaged

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/318420.htmlTechArticleFour-frame home page, five-frame home page For6.0 (GBK) (UTF-8) [12 combination][9-18][moderator installation test passed] Quote: This plug-in was installed by moderator sakurakawaii on WindowsXP at 15:30 on September 8, 2007...
Statement
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
How do you modify data stored in a PHP session?How do you modify data stored in a PHP session?Apr 27, 2025 am 12:23 AM

TomodifydatainaPHPsession,startthesessionwithsession_start(),thenuse$_SESSIONtoset,modify,orremovevariables.1)Startthesession.2)Setormodifysessionvariablesusing$_SESSION.3)Removevariableswithunset().4)Clearallvariableswithsession_unset().5)Destroythe

Give an example of storing an array in a PHP session.Give an example of storing an array in a PHP session.Apr 27, 2025 am 12:20 AM

Arrays can be stored in PHP sessions. 1. Start the session and use session_start(). 2. Create an array and store it in $_SESSION. 3. Retrieve the array through $_SESSION. 4. Optimize session data to improve performance.

How does garbage collection work for PHP sessions?How does garbage collection work for PHP sessions?Apr 27, 2025 am 12:19 AM

PHP session garbage collection is triggered through a probability mechanism to clean up expired session data. 1) Set the trigger probability and session life cycle in the configuration file; 2) You can use cron tasks to optimize high-load applications; 3) You need to balance the garbage collection frequency and performance to avoid data loss.

How can you trace session activity in PHP?How can you trace session activity in PHP?Apr 27, 2025 am 12:10 AM

Tracking user session activities in PHP is implemented through session management. 1) Use session_start() to start the session. 2) Store and access data through the $_SESSION array. 3) Call session_destroy() to end the session. Session tracking is used for user behavior analysis, security monitoring, and performance optimization.

How can you use a database to store PHP session data?How can you use a database to store PHP session data?Apr 27, 2025 am 12:02 AM

Using databases to store PHP session data can improve performance and scalability. 1) Configure MySQL to store session data: Set up the session processor in php.ini or PHP code. 2) Implement custom session processor: define open, close, read, write and other functions to interact with the database. 3) Optimization and best practices: Use indexing, caching, data compression and distributed storage to improve performance.

Explain the concept of a PHP session in simple terms.Explain the concept of a PHP session in simple terms.Apr 26, 2025 am 12:09 AM

PHPsessionstrackuserdataacrossmultiplepagerequestsusingauniqueIDstoredinacookie.Here'showtomanagethemeffectively:1)Startasessionwithsession_start()andstoredatain$_SESSION.2)RegeneratethesessionIDafterloginwithsession_regenerate_id(true)topreventsessi

How do you loop through all the values stored in a PHP session?How do you loop through all the values stored in a PHP session?Apr 26, 2025 am 12:06 AM

In PHP, iterating through session data can be achieved through the following steps: 1. Start the session using session_start(). 2. Iterate through foreach loop through all key-value pairs in the $_SESSION array. 3. When processing complex data structures, use is_array() or is_object() functions and use print_r() to output detailed information. 4. When optimizing traversal, paging can be used to avoid processing large amounts of data at one time. This will help you manage and use PHP session data more efficiently in your actual project.

Explain how to use sessions for user authentication.Explain how to use sessions for user authentication.Apr 26, 2025 am 12:04 AM

The session realizes user authentication through the server-side state management mechanism. 1) Session creation and generation of unique IDs, 2) IDs are passed through cookies, 3) Server stores and accesses session data through IDs, 4) User authentication and status management are realized, improving application security and user experience.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use