REQ: some stuff

GTCustom Pages - Create Custom Pages With Ease

Now, you have the POWER to CREATE CUSTOM PAGES with ease!

ACT NOW AND GET FREE BONUS!
  1. FREE Privacy Policy* (legal policy worth about $100**)
  2. FREE Terms of Services Policy* (legal policy worth about $100**)
  3. FREE Site Map Script
  4. NO COPYRIGHT TEXT visible to end-user!
* No need to edit content as name, companyname, address, etc, etc are all fetched from vBulletin Options.
** I couldn't find a free one that I like so I decided to GIVE you my own Site Policies.

How easy is it to create a custom page?
Create header and content phrase. That's it!

Yea, no joke ... it's that easy.

How to add Links
Add Links In Header: (view attachment)

FIND IN header TEMPLATE:
HTML:
    <td align="$stylevar[RIGHT]">
        &nbsp;
    </td>
REPLACE WITH:
HTML:
     <td align="$stylevar[align=right]">
<a href="goto.php?section=about$session[sessionurl]">$vbphrase[gtcustom_about_header]</a> | <a href="goto.php?section=privacy$session[sessionurl]">$vbphrase[gtcustom_privacy_header]</a> | <a href="goto.php?section=terms$session[sessionurl]">$vbphrase[gtcustom_terms_header]</a> | <a href="goto.php?section=sitemap$session[sessionurl]">$vbphrase[gtcustom_sitemap_header]</a>
        &nbsp;
    </td>
Add Links In Navbar: (view attachment)
FIND IN navbar TEMPLATE:
HTML:
         <td class="vbmenu_control"><a href="faq.php$session[sessionurl_q]" accesskey="5">$vbphrase[faq]</a></td>
REPLACE WITH:
HTML:
<if condition="$show['popups']">        
        <td id="navbar_tools" class="vbmenu_control"><a href="goto.php$session[sessionurl_q]section=about" accesskey="4" rel="nofollow">$vbphrase[help]</a> <script type="text/javascript"> vbmenu_register("navbar_tools"); </script></td>
<else />
        <td class="vbmenu_control"><a href="faq.php$session[sessionurl_q]" accesskey="5">$vbphrase[faq]</a></td>
</if>
FIND:
HTML:
<if condition="$show['popups']">
<!-- NAVBAR POPUP MENUS -->
REPLACE WITH:
HTML:
<if condition="$show['popups']">
<!-- NAVBAR POPUP MENUS -->
    <div class="vbmenu_popup" id="navbar_tools_menu" style="display:none">
        <table cellpadding="4" cellspacing="1" border="0">
        <tr>
            <td class="thead" nowrap="nowrap">$vbphrase[need_help]</td>
        </tr>
        <tr>
            <td class="vbmenu_option" title="$vbphrase[faq]">
            <a href="faq.php$session[sessionurl_q]">$vbphrase[faq]</a>
 
        <tr>
            <td class="vbmenu_option" title="$vbphrase[gtcustom_sitemap_header]">
            <a href="goto.php?section=sitemap$session[sessionurl_q]">$vbphrase[gtcustom_sitemap_header]</a>
 
        <tr>
            <td class="vbmenu_option" title="$vbphrase[gtcustom_about_header]">
            <a href="goto.php?section=about$session[sessionurl_q]">$vbphrase[gtcustom_about_header]</a>
 
        <tr>
            <td class="vbmenu_option" title="$vbphrase[gtcustom_privacy_header]">
            <a href="goto.php?section=privacy$session[sessionurl_q]">$vbphrase[gtcustom_privacy_header]</a>
 
        <tr>
            <td class="vbmenu_option" title="$vbphrase[gtcustom_terms_header]">
            <a href="goto.php?section=terms$session[sessionurl_q]">$vbphrase[gtcustom_terms_header]</a>
            </td>
        </tr>
        </table>
    </div>

#####################################################

Create "Latest Threads" Custom Page

A simple [HOWTO] to display latest threads on a custom page.

If you don't have GTCUSTOM PAGES installed .. go download and upload product via Plugin Manager. You need GTCUSTOM PAGES to follow this article.

LETS GET STARTED

INSTRUCTIONS:
  1. create 2 templates
  2. add 1 phrase
  3. add function to functions_gtcustom.php
  4. edit goto.php
  5. visit page at $vboptions[bburl]/goto.php?section=newthreads
1)__ CREATE 2 TEMPLATES
Create "custom_thread" template:

HTML:
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%">
  <tbody>
    <tr>
      <td class="tcat" colspan="5"><a style="float:$stylevar[align=right]" href="#top" onclick="return toggle_collapse('gtcthreads')"><img id="collapseimg_gtcthreads" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_gtcthreads].gif" alt="" border="0" /></a>$vbphrase[header_title]</td>
    </tr>
    <tr class="thead">
      <td>&nbsp;</td>
      <td class="smallfont" align="$stylevar[align=left]" width="100%">$vbphrase[thread] / $vbphrase[thread_starter]</td>
      <td class="smallfont" align="center" style="white-space:nowrap">$vbphrase[last_post]</td>
      <td class="smallfont" align="center">$vbphrase[replies]</td>
      <td class="smallfont" align="center">$vbphrase[views]</td>
    </tr>
  </tbody>
  <tbody id="collapseobj_gtcthreads" style="$vbcollapse[collapseobj_gtcthreads]">  
  $threadrows
  </tbody>  
</table>
<br />
Create "custom_threadrow" template:
HTML:
<tr>
	<td class="alt2" align="center"><if condition="$show['threadicon']"><img class="inlineimg" src="$thread[iconpath]" alt="" border="0" title="" /> <else />&nbsp;</if></td>
	<td class="alt1"><a href="showthread.php?t=$thread[threadid]"><strong>$thread[title]</strong></a>
		<div class="smallfont"> - by $thread[postusername]</div></td>
	<td class="alt2" align="center"><div class="smallfont time" style="white-space:nowrap">$thread[lastpostdate] $thread[lastposttime]<br />by $thread[lastposter]</div></td>
	<td class="alt1" align="center">$thread[replycount]</td>
	<td class="alt2" align="center">$thread[views]</td>
</tr>
2)__ CREATE 1 PHRASE
Phrase Type: GTCustom Pages
Product: GTCustom Pages
Varname: gtcustom_newthreads_header
Text: Latest Threads

3)__ ADD FUNCTION TO functions_gtcustom.php
Copy the following function to functions_gtcustom.php (functions_gtcustom.php is included in GTCUSTOM PAGES product) [align=left]
PHP:
/* ==========[ PRINT LATEST THREAD ]===================================== */ 
/* ====================================================================== */ 
function print_gtcustom_newthreads() 
{ 
    global $vbulletin, $vbphrase, $threadrows; 
     
    $threadarray = $vbulletin->db->query_read(" 
        SELECT thread.*, icon.title AS icontitle, icon.iconpath 
        FROM " . TABLE_PREFIX . "thread AS thread 
        LEFT JOIN " . TABLE_PREFIX . "icon AS icon ON(icon.iconid = thread.iconid) 
        WHERE  
            thread.visible = 1 
        ORDER BY dateline DESC  
        LIMIT 15"); 
     
    while($thread = $vbulletin->db->fetch_array($threadarray)) 
    { 
        if ($thread['iconid']) 
        { 
            // get icon from icon cache 
            $thread['iconpath'] = $vbulletin->iconcache["$thread[iconid]"]['iconpath']; 
            $thread['icontitle'] = $vbulletin->iconcache["$thread[iconid]"]['title']; 
        } 

        if ($thread['pollid'] != 0) 
        { 
            // show poll icon 
            $show['threadicon'] = true; 
            $thread['iconpath'] = "$stylevar[imgdir_misc]/poll_posticon.gif"; 
            $thread['icontitle'] = $vbphrase['poll']; 
        } 
        else if ($thread['iconpath']) 
        { 
            // show specified icon 
            $show['threadicon'] = true; 
        } 
        else if (!empty($vbulletin->options['showdeficon'])) 
        { 
            // show default icon 
            $show['threadicon'] = true; 
            $thread['iconpath'] = $vbulletin->options['showdeficon']; 
            $thread['icontitle'] = ''; 
        } 
        else 
        { 
            // do not show icon 
            $show['threadicon'] = false; 
            $thread['iconpath'] = ''; 
            $thread['icontitle'] = ''; 
        } 
         
        $thread['lastpostdate'] = vbdate($vbulletin->options['dateformat'], $thread['lastpost'], 1); 
        $thread['lastposttime'] = vbdate($vbulletin->options['timeformat'], $thread['lastpost']); 
        eval('$threadrows .= "' . fetch_template('custom_threadrow') . '";'); 
    } 
    unset($threadarray); 
    return $threadrows; 
}

4)__ EDIT goto.php
FIND IN goto.php:
PHP:
        default;             
            eval('$HTML = "' . fetch_template('custom_mypage') . '";');

REPLACE WITH:
PHP:
        case 'newthreads'; 
            $threadrows = print_gtcustom_newthreads();             
            eval('$HTML = "' . fetch_template('custom_thread') . '";');             
            break; 
        default;             
            eval('$HTML = "' . fetch_template('custom_mypage') . '";');

FIND:
PHP:
if ($_REQUEST['section']=='sitemap') 
{ 
    $globaltemplates[] = 'custom_sitemap'; 
}

REPLACE WITH:
PHP:
switch($_REQUEST['section']) 
{ 
    case 'sitemap'; 
        $globaltemplates[] = 'custom_sitemap'; 
        break; 
    case 'newthreads'; 
        $specialtemplates[] = 'iconcache'; 
        $globaltemplates = array_merge($globaltemplates, array('custom_thread', 'custom_threadrow')); 
        break; 
}

5)__ DONE!
Now, go visit the page that you just created:
$vboptions[bburl]/goto.php?section=newthreads

Need any help? Contact me personally via private message.

NOTE:
  1. All html code is valid XHTML.
  2. This query will display all thread titles regardless of permission settings.
###############################################################

Create Custom Pages

GO-TOTAL LLC had everyone in mind when GTCustom Pages was created.
Custom pages can now be created with little or no coding knowledge.

If you know how to create a phrase within ADMINCP / LANGUAGES then you can create custom pages with ease.

First Download and install product and...

Let's Create A Custom "About Us" Page:
  1. In your favorite editor, create the contents of the page. HTML is allowed.
  2. When you finish with the contents of the page, create 2 phrases (an optional subtitle is available).
    • "gtcustom_about_header" - title of custom page
    • "gtcustom_about" - contents of custom page
    • "gtcustom_about_subtitle" -optional subtitle for custom page; the subtitle (table cell) will only display if it's created
  3. That's it! Now, go visit the page via URL: $vboptions[bburl]/goto.php?section=about
NOTE:
- Replace bold text with your choice of name. Follow naming convention as described above or the pages will not display.
- All 'xxx_header' phrases should be added to GLOBAL phrase group. (Needs to be global to display in navbar, etc.)
- All other phrases are required to be in GTCustom Pages phrase group. (If it's not here, cutom page will not work.)
Tips:
  • URL looks good with mod-rewrite enabled.
    For example, $vboptions[bburl]/goto/section/about, $vboptions[bburl]/goto_section_about.html
  • Use short names to prevent mod-rewrite (SEO links) problems. (It really depends on your setup. For example, some SEO scripts will convert every '_' into '/'. Which will prevent custom page from being displayed.)
    • Examples:
      • about - (GOOD)
      • terms - (GOOD)
      • privacy - (GOOD)
      • about_us - (BAD)
      • terms_of_service - (BAD)
      • privacy_policy - (BAD)
Examples Included With Product:
  • About Us Custom Page - phrases: gtcustom_about_header, gtcustom_about
    URL: $vboptions[bburl]/goto.php?section=about
  • Terms Of Service Custom Page - phrases: gtcustom_terms_header, gtcustom_terms
    URL: $vboptions[bburl]/goto.php?section=terms
    Additional options available in Admincp/ vBulletin Options/ Site Name / URL / Contact Details to create Terms of Service
  • Privacy Policy Custom Page- phrases: gtcustom_privacy_header, gtcustom_privacy
    URL: $vboptions[bburl]/goto.php?section=privacy

[/RIGHT]
 
Back
Top