Skip to content

hu60t/hu60wap6

Folders and files

Name Name
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hu60wap6

Hu60wap6 is a community system

Written by PHP

The interface is simple, very simple, especially simple, just like the mobile web page in the non smartphone era

Well, this style is really inherited from the non smartphone era

The main functions of hu60wap6 are: forum, chat room, internal message, @ Ta, file image upload, audio and video insertion in speeches

Other functions include: common codec for programming, HTTP request viewer (see browser UA)

It is published using the GPLv3 protocol

Source code acquisition description

This project contains two sub modules, so it is recommended to use git to clone the project and all its sub modules. The command is as follows:

 git clone --recursive  https://gitee.com/hu60t/hu60wap6.git

If you have cloned the project, but it does not contain submodules, you can obtain it through the following command:

 git submodule init git submodule update

If you download the source code package, you need to manually obtain the sub module and place it in the corresponding location. Please refer to the url and path .gitmodules

Installation instructions

be careful

Site source code is processed by symbolic connection There are multiple files with the same content in different locations In this case, symbolic links are easily lost when compressing and decompressing files.

If the website is running in Windows, it is recommended to run it in WSL git clone Or decompress zip To preserve the symbolic connection.

If the website is running in Linux, please do not decompress the source code in Windows and repackage it, or the symbolic connection will be lost. You can consider downloading and decompressing the source code directly from the command line in Linux, or use git clone Command to get the source code.

If you use Linux desktop, it is not recommended to use Linux 360 compression, nor does it support symbolic connection.

For Android, please do not put the source code on the memory card or analog memory card( /sdcard perhaps /storage ), because neither of them supports symbolic links. If you don't have root permission, only the internal storage directory provided by the terminal emulator (such as Termux) supports symbolic links. Because the source code cannot be placed on the analog memory card, Tiger Greenwood is actually incompatible with the graphical interface web server on Android, and can only be run in the terminal simulator using the command line web server.

In addition, on the Git for Windows Enabling symbolic connection support in does not solve this problem, as described in step 8.

If the symbolic connection has been lost, you will encounter The configuration file "site. info" does not exist Error, follow the instructions in step 8 to manually copy the file to resolve the problem. be careful site_info.conf The name needs to be changed to info.conf

However, the files to be copied in step 8 are not a complete list. Tiger Green Forest has been increasing the use of symbolic links. At present, the complete list cannot be listed, nor do I want to list it. Please use WSL to treat yourself better. For Android, it's a pity that Google chose to let the analog memory card not support symbolic connection, so Tiger Greenwood can only say goodbye to the graphical interface web server on Android.

Installation Tutorial

General installation steps

  1. hold src All files in the folder are placed in the root directory of the website.

  2. If you use Linux, you can replace the following two steps with the following command:

     # First cd to the root directory of the website php script/init.php

    If you use Windows, the above command may not work. Please copy the file manually according to the following two steps.

  3. Enter the root directory of the website config.inc.default.php Make a copy and change the name to config.inc.php And then config All in folder xxx.default.php Copy one copy, rename it xxx.php, and remove .default If you plan to use git for version control, it is recommended to copy rather than delete the original file or rename the original file directly.

    In other words, put config.inc.default.php Copy As config.inc.php , and then config/xxx.default.php Copy As config/xxx.php

  4. get into config/tpl Folder, turn site_info.default.conf Make a copy and change the name to site_info.conf

    In other words, put config/tpl/site_info.default.conf Copy As config/tpl/site_info.conf

  5. modify config/db.php , fill in the mysql information.

  6. Import db/mysql.sql To the database.

  7. visit.

  8. In Windows, you may encounter such errors:

     Syntax error in config file 'conf:site.info' on line 1 '../../../../ config/tpl/site_info.conf'

    Or such error:

     Fatal error: Uncaught PageException: The configuration file "site. info" does not exist

    This is because the Windows decompressor or git tool you are using does not support symbolic links, so the source location of the link is saved as the text content in the target location. To solve this problem, you need to copy multiple files from the source location to the target location, which are:

    • src/config/tpl/site_info.conf -> src/tpl/classic/html/site/info.conf (Note that the file name should be changed to info.conf )
    • src/config/tpl/site_info.conf -> src/tpl/jhin/html/site/info.conf (Note that the file name should be changed to info.conf )
    • There are more that cannot be listed, including various js files. Tiger Green Forest is increasingly relying on symbolic links, so please use the git clone Get the source code and be nice to yourself.

    In addition, we also need to remind you that you should not submit these changes to the git repository, because we want to keep symbolic links instead of multiple copies of the same file.

    If you want to avoid these troubles, it is recommended to run it in WSL (Windows Subsystem of Linux) git clone To obtain the source code, the git in WSL can correctly create the symbolic connection. In addition, you can also run a web server in WSL.

    New version Git for Windows If relevant options are enabled, symbolic connection can also be created, but it is not applicable to this project. Because the source file of symbolic connection does not exist in clone project Git for Windows Only text files whose content is the source file location will be created as an alternative.

    For Android, please do not put the source code on the memory card or analog memory card( /sdcard perhaps /storage ), because neither of them supports symbolic links. If you don't have root permission, only the internal storage directory provided by the terminal emulator (such as Termux) supports symbolic links. Because the source code cannot be placed on the analog memory card, Tiger Greenwood is actually incompatible with the graphical interface web server on Android, and can only be run in the terminal simulator using the command line web server.

  9. Users with a uid of 1 will become administrator users of the system and can access the background (although the background only has the function of adding sections, the function of modifying sections will crash.)

  10. In order for the attachment upload function to take effect, it is not only necessary to correctly set the Qiniu Cloud AK/SK, modify the domain name in html, but also to correctly install the nonfree For sub module, refer to the section "Source code acquisition description".

  11. In order for the CC prevention function to take effect, PHP access is required for Linux /dev/shm Folder (this folder is a shared memory folder within Linux). For Apache, use the following configuration:

 Php_admin_value open_basedir "web root: other path:/dev/shm/"

For example:

 php_admin_value open_basedir "/var/www/hu60.cn/src/:/tmp/:/usr/share/phpmyadmin/:/usr/share/php/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/dev/shm/"

For Windows, modify config.inc.php Path in( $CC_DATA And so on), and create the corresponding folder.

Supported PHP versions

  • PHP 7
  • PHP 8

Unsupported PHP version

  • PHP 5

In order to be compatible with PHP8.1, compatibility with PHP5 is abandoned.

How to develop new themes

Novice difficulty

  1. Download the source code and install it according to the above instructions. The root directory of the website is in the source code directory src Folder, so the following folder paths are omitted src
  2. Visit the website and switch to Classic theme because Classic theme It is easy to modify.
  3. get into tpl/classic/html/index Folder( Classic theme Folder), inside index.tpl It is the content of the home page. Change the html code according to your idea, but don't move any curly braces without understanding( {} )The content inside is the smart template tag.
  4. get into tpl/classic/css Folder default.css It is the default css, which can be modified as you like. night.css Is the corresponding night mode css.
  5. tpl/classic/img There are pictures in the folder, such as hulvlin2.gif Is the default logo. Inside face The folder contains the expression pack. For the file name naming rules of emoticon packs, see here
  6. tpl/classic/html/bbs Inside are templates for various pages of the forum. Basically, open the file and you will know which page it is. Modify at will.
  7. tpl/classic/html/user Is the user center, tpl/classic/html/addin There are chat room templates, etc.
  8. If you want to modify the head and tail of the page tpl/classic/html/comm Inside, they are head.tpl and foot.tpl

Expert difficulty

  1. Download the source code and install it according to the above instructions. The root directory of the website is in the source code directory src Folder, so the following folder paths are omitted src
  2. get into tpl Folder, turn classic perhaps jhin Make a copy of the folder. Which copy depends on which basic theme you want to use for transformation. classic It is relatively simple, but the older template technology is used. jhin More complex and uses modularity( block )Substitution classic Of include
  3. Next, open sub/reg_page_bid.php , add on the last line Page:: regTpl ('Name of your theme folder ');
  4. visit Http://Your domain name/q.php/link.tpl. Your theme folder name.html Switch to your theme.
  5. Start modifying your theme. Tpl/Subject Name The directory structure under is relatively simple. html The folder contains pages smarty Templates, placed on and url In the first part of the directory with the same name. such as Http://Your domain name/q.php/bbs.topic.xxx.html The corresponding PHP file is page/bbs/topic.php , which is loaded with tpl:topic This template corresponds to Tpl/topic name/html/bbs/topic.tpl
  6. Smart's template separator is the default {}
  7. Reference Template( {include file="here"} )The format of the template name filled in is as follows: Tpl: template file name or Tpl: directory name.template file name , such as tpl:topic perhaps tpl:bbs.topic , with Directory name The main purpose of is to access templates that are not in the same directory as the current file. Similarly, the configuration file under the topic( *.conf )You can also use similar names to refer to: Conf: configuration file name perhaps Conf: directory name. configuration file name
  8. Tpl/subject name/html/comm In it are public templates, which can be used to place templates referenced by various pages, such as header, footer, etc.
  9. There are some global variables available in the template, such as:
    • $CID The class id is the first part of the url, such as Http://Your domain name/q.php/bbs.topic.xxx.html In bbs
    • $PID The page id is the second part of the url, such as Http://Your domain name/q.php/bbs.topic.xxx.html In topic
    • $BID The feed id, which is the last part of the url, is equivalent to the extension, such as Http://Your domain name/q.php/bbs.topic.xxx.html In html
    • $USER Current user object, class/user.php lower User Class. Note that the current user may not be logged in( $USER->islogin == false )As a result, some properties cannot be obtained.
    • $PAGE Current page object, class/page.php lower Page Class. $PAGE The object can be used to obtain various other details in the current page URL, as well as the absolute path of some static resources (such as {$PAGE->getTplUrl("img/hulvlin2.gif")} , get Tpl/Subject name/img/hulvlin2.gif The absolute URL of this file).
  10. PHP functions can be called directly in the template, such as {date('Y-m-d')} Or static class method {str::ago(time()-30)}
  11. If you want to output the content written by the user, remember to call |code Decorator htmlspecialchars() Operation, such as: {$topic.content|code}

About

A PHP forum website source code | hu60wap6 is a community website system developed for Hu60. cn

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published