| |
| | |

CodersClub

 Forgot password?
 Register
Search
View: 14727|Reply: 6
Collapse the left

DISCUZ Single page production

[Copy link]
Post time: 2013-08-11 19:08
| Show all posts |Read mode
Addon
Title: DISCUZ Single page production
Version: X1.0 X2.5 X3.0
Author: -
Author URL:
Description: DISCUZ Single page production
Discuz! X Version: X3 X2.5 X2 
Language(s): ALL
Create Date:
Last Update:
Screenshot: -
本帖最后由 vincent 于 2013-8-16 19:06 编辑

本帖最后由 vincent 于 2013-8-14 05:24 编辑

Single page, including two files:
1. the single page PHP file demo.php
2. the single page template file demo.htm.

demo.php:
  1. <?php
  2. define('CURSCRIPT', 'test');
  3. require './source/class/class_core.php';
  4. $discuz = & discuz_core::instance();
  5. $discuz->init();
  6. loadcache('diytemplatename');
  7. $navtitle = 'Demo';
  8. $metakeywords = 'Demo';
  9. $metadescription = 'Demo';
  10. include template('diy:forum/demo');
  11. ?>
Copy the Code


demo.htm:
  1. <!--{template common/header}-->
  2. <style id="diy_style" type="text/css"></style>
  3. <div id="pt" class="bm cl">
  4.     <div class="z">
  5.         <a href="./" class="nvhm" title="{lang homepage}">$_G[setting][bbname]</a><em>&raquo;</em>
  6.         <a href="forum.php">$_G[setting][bbname]</a><em>&raquo;</em>
  7.         <a href="javascript:;">$navtitle</a>
  8.     </div>
  9. </div>

  10. <div class="wp">
  11. <!--[diy=diy2]--><div id="diy2" class="area"></div><!--[/diy]-->
  12. </div>


  13. <div id="ct" class="wp cl">
  14.     <div class="mn bm cl">
  15.         <div class="bm_c">
  16.         
  17.             <p style="width:300px; margin:200px auto; text-align:center;">demo</p>
  18.             
  19.         </div>
  20.     </div>
  21. </div>

  22. <!--{template common/footer}-->
Copy the Code
PHP file code can DIY single page content is as follows:

Find:
  1. include template('forum/demo');
Copy the Code
replace with:
  1. include template('diy:forum/demo');
Copy the Code


The DEMO for demo.htm


demo.htm Under your template\forum


[edited by vot]

This post contains more resources

You have to Login for download or view attachment(s). No Account? Register

x

Rate

Number of participants 1Rating +1 Collapse Reason
vot + 1 Usefull

View Rating Log

 Palestine

Post time: 2013-08-13 18:12
| Show all posts
Wonderful!
Post time: 2013-08-16 15:18
| Show all posts
Thanks. But what about header? It's switching default language to english.
 Author| Post time: 2013-08-16 18:09
| Show all posts
kaaleth 2013-8-16 16:18
Thanks. But what about header? It's switching default language to english.

I'm very sorry, I can't understand what you mean

demo.php   In the root directory
demo.htm   IN template\forum

 Russia

Post time: 2013-08-16 20:08
| Show all posts
I'm very sorry, I can't understand what you mean

Kaaleth said that the code is very good for original Discuz,
but is slightly incompatible with the ML version.

I.e. some additional localization required:
  1. ...
  2. $discuz->init();
  3. /*vot*/        settings_localize(); // Localize Navigation & Settings
  4. ...
Copy the Code

Rate

Number of participants 1Rating +1 Collapse Reason
kaaleth + 1 Usefull

View Rating Log

 Turkey

Post time: 2014-04-27 13:08
| Show all posts
Compatiple with x3.1?

Comments

Yes it is.  Post time 2014-04-27 13:46
You have to log in before you can reply Login | Register

Points Rules

Archive|Mobile|Dark room|CodersClub

Top.Mail.Ru
Top.Mail.Ru

2024-11-22 10:40 GMT+3 , Processed in 0.069404 sec., 19 queries .

Powered by Discuz! X3.4 Release 20230520

© 2001-2024 Discuz! Team.

MultiLingual version, Rev. 4301, © codersclub.org

Quick Reply To Top Return to the list