The vB Geek

Go Back   The vB Geek > vB Geek Products > Geek Article and Review System

Geek Article and Review System GARS is the mega popular system for turning forums into articles, tutorials, or even reviews.

Advertisement
  Learn how to remove ads

Reply
 
Thread Tools Display Modes
  #1  
Old 05-19-2007, 03:17 PM
Dr. Bantham Dr. Bantham is offline
Member
 
Join Date: Mar 2007
Posts: 31
Geek Article and Review System License Holder Geek Auto-Linker Pro License Holder Geek Gazette License Holder 
Default Adding Post Reference to TOC Links for Anchoring to Text Start

I am using GARS to function as a literature repository. I love it! While formatting an especially large article with an extensive TOC, I investigated being able to default the view to the beginning of the article text when jumping via the TOC. I discovered that if I affix the post reference to the end of the url, it will do just what I want.

For instance, the normal URL gererated is:
http://www.ligotti.net/showthread.php?t=1131&garpg=9
This results in the first image view attached.

If I manually change this URL in the address box of the browser to:
http://www.ligotti.net/showthread.ph...rpg=9#post6615
It results in the second image view attached (just what I want).

This allows for maximixing the view area without instantly scrolling down to read the content every time. You can jump through the TOC with ease, even with long articles. Note that at the time of creating this post the article is being edited within a secure admin directory, therefore it can not be accessed by others.

My question is:
How can I edit the template to default the TOC links into including the post reference within the URL?
Attached Images
File Type: jpg cathr1.jpg (47.3 KB, 7 views)
File Type: jpg cathr2.jpg (85.0 KB, 9 views)
Reply With Quote
  #2  
Old 05-19-2007, 08:57 PM
The Geek's Avatar
The Geek The Geek is offline
Senior Member
 
Join Date: Aug 2005
Posts: 6,717
Geek Article and Review System License Holder GeekMart License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder Geek Gazette License Holder 
Default

hey, cool idea. Edit the geek/mods/display/toc.php module to enter the $post['postid']
Reply With Quote
  #3  
Old 05-20-2007, 12:00 AM
Dr. Bantham Dr. Bantham is offline
Member
 
Join Date: Mar 2007
Posts: 31
Geek Article and Review System License Holder Geek Auto-Linker Pro License Holder Geek Gazette License Holder 
Default

I see the showthre.php URL strings below, but I am not sure about the format and exact placement for adding $post['postid']. Can someone help?
PHP Code:
            if ($this->navigation['pagecount'] > 1)
            {
                
$bits "<tr><td ><ul>";
                
$bits.="<li><div class='smallfont'><a href='showthread.php?t=$threadinfo[threadid]'>";
                
$bits.=($settings['name'] ? $settings['name'] : ($settings['allow_title'] && $this->data['custom1']['toc_title'] ? $this->data['custom1']['toc_title'] :$vbphrase["GARS_page1"]));
                
$bits.="</a></div></li>";

                for(
$toc_x 1$toc_x $this->navigation['pagecount']; $toc_x++)
                {
                    
$bits.="<li><div class='smallfont'><a href='showthread.php?t=$threadinfo[threadid]&amp;garpg=" . ($toc_x 1). "'>";
                    
$bits.=$this->navigation['pages'][$toc_x]['text'] ? $this->navigation['pages'][$toc_x]['text'] : construct_phrase($vbphrase['GARS_pagex'],($toc_x 1));
                    
$bits.="</a></div></li>";

                }
                
$bits .= "</ul></td></tr>";
                
$title $vbphrase["GARS_contents"];
                eval(
'$output.="' fetch_template('GARS_mod_container') . '";');
            } 
__________________
THOMAS LIGOTTI ONLINE
A Shining Brainless Beacon Of Elegant Mutations And Cunning Annihilations
Reply With Quote
  #4  
Old 05-20-2007, 07:19 AM
The Geek's Avatar
The Geek The Geek is offline
Senior Member
 
Join Date: Aug 2005
Posts: 6,717
Geek Article and Review System License Holder GeekMart License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder Geek Gazette License Holder 
Default

ok, there is a better way. Edit the gars_pb template and put the following where you want the page to jump to:

<a name="contentstart"></a>

Then append #contentstart to the end of the URL bits. That will be easier.

HTHs
Reply With Quote
  #5  
Old 05-20-2007, 11:42 AM
Dr. Bantham Dr. Bantham is offline
Member
 
Join Date: Mar 2007
Posts: 31
Geek Article and Review System License Holder Geek Auto-Linker Pro License Holder Geek Gazette License Holder 
Default

Works like a charm! I also amended GARS_navigation to do the same. I'll post the revisions I made later in case someone else is interested. If you have long documents and are using the TOC, it is an awesome tweak.
__________________
THOMAS LIGOTTI ONLINE
A Shining Brainless Beacon Of Elegant Mutations And Cunning Annihilations
Reply With Quote
  #6  
Old 05-21-2007, 08:23 AM
The Geek's Avatar
The Geek The Geek is offline
Senior Member
 
Join Date: Aug 2005
Posts: 6,717
Geek Article and Review System License Holder GeekMart License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder Geek Gazette License Holder 
Default

Its a great overall suggestion. I may roll it into the standard feature set.

Thanks!
Reply With Quote
  #7  
Old 05-23-2007, 12:41 AM
Dr. Bantham Dr. Bantham is offline
Member
 
Join Date: Mar 2007
Posts: 31
Geek Article and Review System License Holder Geek Auto-Linker Pro License Holder Geek Gazette License Holder 
Default

OK, this is my finished result:
http://www.ligotti.net/showthread.php?t=1136

This is a soon to be published book (permission granted), resulting in an extremely long article which has been broken down into chapters and sub-chapters. If you click on TOC items, it will consistently show the beginning of the content at the top of the browser screen. Switching between sections allows for a clean display with maximum content viewable. Check out the footnotes for another effect that I have integrated, being cross-indexed hyperlinks that allow you to toggle between the reference and the footnotes. Note that the document is for "those for whom philosophical and literary works of pessimism, nihilism, and defeatism are essential to their being." You have been forewarned!

And here are the revisions made:

OPEN gars_pb template
FIND:
PHP Code:
                    <td class="alt1" valign="top" width="100%" style="padding:10px;" 
INSERT LINE BEFORE:
Code:
<a name="contentstart">
You can move this higher in the code if you wish the title block to be displayed consistently.

OPEN geek/mods/gars/display/toc.php (or your custom path):
FIND:
PHP Code:
class='smallfont'><a href='showthread.php?t=$threadinfo[threadid]'>"; 
REPLACE WITH:
PHP Code:
class='smallfont'><a href='showthread.php?t=$threadinfo[threadid]#contentstart'>"; 
FIND:
PHP Code:
class='smallfont'><a href='showthread.php?t=$threadinfo[threadid]&amp;garpg=" . ($toc_x + 1). "'>"; 
REPLACE WITH:
PHP Code:
class='smallfont'><a href='showthread.php?t=$threadinfo[threadid]&amp;garpg=" . ($toc_x + 1). "#contentstart'>"; 
__________________
THOMAS LIGOTTI ONLINE
A Shining Brainless Beacon Of Elegant Mutations And Cunning Annihilations

Last edited by Dr. Bantham; 06-01-2008 at 12:43 PM.. Reason: Filename Typo
Reply With Quote
  #8  
Old 05-23-2007, 06:36 AM
The Geek's Avatar
The Geek The Geek is offline
Senior Member
 
Join Date: Aug 2005
Posts: 6,717
Geek Article and Review System License Holder GeekMart License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder Geek Gazette License Holder 
Default

As an FYI, I integrated this functionality into 2.1.8 however the page anchor is a tad bit higher (it shows the header).

Thanks!
Reply With Quote
  #9  
Old 05-24-2007, 12:24 AM
Tigratrus's Avatar
Tigratrus Tigratrus is offline
Senior Member
 
Join Date: Nov 2006
Posts: 206
Geek Article and Review System License Holder GeekMart License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder Geek Gazette License Holder 
Default

Nice work!

Susan and James
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove links in certain post? John D Geek Auto-Linker 4 04-23-2008 04:56 PM
Adding to vBa Links Bluestrike2 Geek Advertising Banner System 6 02-10-2007 02:28 PM
adding moderation text benj Geek Article and Review System 1 09-13-2006 09:05 AM
I need to show the text links of tuts on a non vb page nbento Geek Article and Review System 3 06-07-2006 03:49 PM
GAL Linking Text Inside Links chet Geek Auto-Linker 5 05-01-2006 06:10 PM


All times are GMT. The time now is 03:09 PM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.