China
|
本帖最后由 leon 于 2013-10-31 08:26 编辑
Some times, we need to write "stand alone" pages. I mean, write the page's content completely by yourself. But, of course, you won't like to write all the html codes.
Here are some ways to show you how to write a single page.
Method 1(Easiest):
1. Write or copy a single page's template file, put it in your folder "/[your template]/portal/portal_topic_[xxx].htm", and you can give it a name to display in your discuz console by code "<!--[name]your diy template[/name]-->".- <!--{subtemplate common/header}-->
- <!--[name]ifpay diy template[/name]-->
- <style id="diy_style" type="text/css"></style>
- <div id="pt" class="bm cl">
- <div class="z">
- <a href="./" class="nvhm" title="{lang homepage}">$_G[setting][bbname]</a><em>»</em>
- <a href="forum.php">$_G[setting][bbname]</a><em>»</em>
- <a href="javascript:;">$navtitle</a>
- </div>
- </div>
- <div class="wp">
- <!--[diy=diy1]--><div id="diy1" class="area"></div><!--[/diy]-->
- </div>
- <div id="ct" class="wp cl ct2">
- <div class="mn bm cl" style="float:left;">
- <div class="bm_h">
- <div align="right">What do you want to show here?<A title="" href="http://www.xxx.com/thread-15109-1-1.html" target=_blank><FONT color=#1a6be6>Click to submit</FONT></A></div>
- </div>
- <div class="bm_c">
- <!--[diy=diy5]--><div id="diy5" class="area"></div><!--[/diy]-->
- </div>
-
- </div>
-
- <div class="sd" style="float:right;">
-
- <div class="bm">
- <div class="bm_h">
- <h2>Menu1</h2>
- </div>
- <div class="bm_c">
- <p class="xl xl2 cl" style="line-height:25px;">
- <!--[diy=diy2]--><div id="diy2" class="area"></div><!--[/diy]-->
- </p>
- </div>
- </div>
-
- <div class="bm">
- <div class="bm_h">
- <h2>Menu2</h2>
- </div>
- <div class="bm_c">
- <!--[diy=diy3]--><div id="diy3" class="area"></div><!--[/diy]-->
- </div>
- </div>
-
- <div class="bm">
- <div class="bm_h">
- <h2>Menu13</h2>
- </div>
- <div class="bm_c" >
- <!--[diy=diy4]--><div id="diy4" class="area"></div><!--[/diy]-->
- </div>
- </div>
- </div>
- </div>
- <div class="wp">
- <!--[diy=diy6]--><div id="diy6" class="area"></div><!--[/diy]-->
- </div>
- <!--{subtemplate common/footer}-->
Copy the Code 2. Create a topic by discuz admin console.
3. Done.
Method 2(If you don't want to manage the single page by discuz topic):
1. Repeat method 1's step 1.
2. Add a php file in your discuz's home folder. for example: http://localhost/discuz/xxx.php
3. Write codes.- <?php
- define('APPTYPEID', 0); //Module ID, not repeat with other
- define('CURSCRIPT', 'ifpay');//Body's Class
- require './source/class/class_core.php';//Import discuz system
- $discuz = & discuz_core::instance();// initial it
- $discuz->init();
- loadcache('diytemplatename');//If your need DIY, you need to add this.
- $navtitle = 'SDK FAQ'; //'Single page's title';
- $metakeywords = 'Android SDK, Mobile Payment, SMS Shortcode'; //'keywords1,ketwords2';
- $metadescription = 'ifpay android SMS shortcode sdk for mobile payment'; //'description';
- include template('diy:portal/portal_topic_diy');//import your template file
- ?>
Copy the Code 4. Done.
Why we need to add a single page like this?
1 reason is that you can write any content in this page, and make its content language switch with your language pack.
|
This post contains more resources
You have to Login for download or view attachment(s). No Account? Register
x
|