Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Internal Links and Anchors Y22 0.1b (Read 9442 times)
Curtiss Grymala
God Member
*****
Offline


YaBB?... Y Not?

Posts: 1314
Joined: Apr 12th, 2004
Gender: Male
Internal Links and Anchors Y22 0.1b
Nov 16th, 2007 at 1:46am
Print Post  
This is a mod for YaBB 2.2
More language files and additional discussion from the Y2.1 version of this mod can be found in the original topic.

This mod allows you to create anchors within your posts, and link to those anchors, so that you can break up your posts/topics into various sections.

To use this mod, you will simply use the following tag to generate the anchor:
Code
Select All
[anchor=Testing]This is a test anchor[/anchor] 



and the following tags to link to that anchor (as long as you are linking from within the same page):
Code
Select All
[link goto=Testing]This is a link that will lead you to the anchor "Testing"[/link] 



Unlike other forum software, where it is virtually impossible to create links that will open in the same window (since the "url" tag always creates a blank target), YaBB makes it easy to open links in the same window by using the "link" tag instead.  This mod makes use of that link tag, and takes it one step further by making it really easy to link to anchors that you've created in your topic.

You might also want to find the following in your Sources/Post.pl (yours may look slightly different, which is why I did not include this alteration in this mod):

           <div style="width: 484px; clear: both;">
           <div style="width: 391px; float:left;">

and replace the widths with values that are approximately 25 to 30 pixels wider (in this example, that would be 514 and 421).

Changelog:
From 0.1b
Ported this mod over to Y2.2
From 0.1a
Added two new UBBC buttons to Post page.

You can see this mod in action over at:
http://dcevolution.net/cgi-bin/yabb/YaBB.pl?num=1129386190/0#1
  

Currently using Y2.3 With no mods (though that will hopefully change, soon).

Click Here To See A List Of All The Mods I've Written
Back to top
WWW  
IP Logged
 
Cable
Junior Member
**
Offline


I love YaBB 1G - SP1.2!

Posts: 97
Joined: Sep 28th, 2007
Re: Internal Links and Anchors Y22 0.1b
Reply #1 - Nov 30th, 2007 at 9:51pm
Print Post  
Curtiss,

Thanks for this mod... works great!

Couple of suggestions if I may...

1. The mod instructions (that show up in the center text box of BoardMOD) do not say anything about the need to upload the additional files provided in the mod zip file.  This was no problem for me, however someone new at modding might miss this step entirely.  Perhaps add a statement saying those files are there and need to be uploaded as well.

2. I initially got errors in Step 4 because I have my files for mod in this directory structure:

D:/HOPforum for MOD/yabb/folders and files
D:/HOPforum for MOD/yabbfiles/folders and files

but this mod looked for this file structure:

D:/HOPforum for MOD/cgi-bin/yabb/folders and files
D:/HOPforum for MOD/public_html/yabb/folders and files

Again, it was no big deal to add those folders into my path, but other mods did not require them (Boardpass, WhoPosted, for example).  Food for thought.

3. The note about widening the text box - the code in Post.pl is quite different than your example.  I have identified the places I need to change, but it took a bit of hunting.

(I haven't altered size yet so my button rows look akward, but I wanted to test the mod first.)

Aside from those items, it's teriffic, and it works GREAT!










                       
  
Back to top
 
IP Logged
 
Cable
Junior Member
**
Offline


I love YaBB 1G - SP1.2!

Posts: 97
Joined: Sep 28th, 2007
Re: Internal Links and Anchors Y22 0.1b
Reply #2 - Dec 1st, 2007 at 11:17am
Print Post  
An update:

I was looking to get both of the button icons together on the right side of the top row.. as seen in this screenshot



Let me say up front that I probably know more Swahili than I do any kind of code, so if the following code listings are horrible, that's just my lack of knowledge.

I modified my Post.pl file in the following ways AFTER doing the mod, so it's mostly just a rearrangement of what the mod code itself did.  But to show the steps, I'll use a "<find> and.." format for clarity.


Code
Select All
<find>

document.write("<img src='$imagesdir/timestamp.gif' onclick='timestamp($date);' "+HAND+" align='top' width='23' height='22' alt='$post_txt{'245'}' title='$post_txt{'245'}' border='0' \/><br />");
~;

<replace with>

document.write("<img src='$imagesdir/timestamp.gif' onclick='timestamp($date);' "+HAND+" align='top' width='23' height='22' alt='$post_txt{'245'}' title='$post_txt{'245'}' border='0' \/>");
~;

# removes the line break 



then moved your mod code parts together, adding the line break at the end...

Code
Select All
<find>

document.write("<img src='$imagesdir/timestamp.gif' onclick='timestamp($date);' "+HAND+" align='top' width='23' height='22' alt='$post_txt{'245'}' title='$post_txt{'245'}' border='0' \/>");
~;


<add after>

# Begin Internal Links and Anchors Code

	fopen(FILE, "$vardir/AnchorSettings.txt");
		$thedata = <FILE>;
	fclose(FILE);
	($anchor_val,$anchor_button) = split (/\|/, $thedata);
	$anchor_dir .= qq~$modimgurl/anchor_buttons/$anchor_button~;

if($anchor_val eq 'yes') {
$yymain .= qq~	    document.write("<img src='$anchor_dir/anchor.gif' onclick='anchor();' "+HAND+" align='top' width='23' height='22' alt='$anchor_txt{'4'}' title='$anchor_txt{'4'}' border='0' />");~;
}

	# End Internal Links and Anchors Code

if($anchor_val eq 'yes') {
$yymain .= qq~	    document.write("<img src='$anchor_dir/anchor_link.gif' onclick='anchor_link();' "+HAND+" align='top' width='23' height='22' alt='$anchor_txt{'5'}' title='$anchor_txt{'5'}' border='0' /><br />");~;
}


# adds both buttons to right side of top row and adds line break after link icon 




I expanded the width using both of these.  Unfortunately I was not smart enough to do them one at a time, so I'm not even sure I need both.

Code
Select All
<find>

<div style="float: left; width: 440px;">

<replace with>

<div style="float: left; width: 495px;">

# expands width to allow for 2 more icons 




Code
Select All
<find>

document.write('<div style="width: 437px; float: left;">');

<replace with>

document.write('<div style="width: 493px; float: left;">');

#expands width to allow for 2 more icons 




Making those changes gave me the buttons just as they show in the picture.  

I like this MOD... very handy!

Thanks.


  
Back to top
 
IP Logged
 
mattcch
New Member
*
Offline


Web

Posts: 45
Joined: Jun 8th, 2007
Gender: Male
Re: Internal Links and Anchors Y22 0.1b
Reply #3 - Dec 29th, 2007 at 1:01am
Print Post  
Compelling mod, and it is very good for long essay or  posted article.Awesome.Works ok after installed.  Smiley
  
Back to top
WWW  
IP Logged
 
Curtiss Grymala
God Member
*****
Offline


YaBB?... Y Not?

Posts: 1314
Joined: Apr 12th, 2004
Gender: Male
Re: Internal Links and Anchors Y22 0.1b
Reply #4 - Jan 9th, 2008 at 12:55am
Print Post  
Thanks for the update, Cable.  Hopefully I'll have a chance to add those notes into the mod in the next month or so.

Unfortunately, I've been really busy dealing with stuff at home lately, and haven't had much time to code.
  

Currently using Y2.3 With no mods (though that will hopefully change, soon).

Click Here To See A List Of All The Mods I've Written
Back to top
WWW  
IP Logged
 
KingDutka
Junior Member
**
Offline


"Word"

Posts: 91
Joined: Nov 9th, 2001
Gender: Male
Re: Internal Links and Anchors Y22 0.1b
Reply #5 - Apr 6th, 2010 at 11:47pm
Print Post  
Any chance on getting an updated version that'll be compatible with YaBB 2.4?  I've got the latest YaBB installed right now and I am looking to write up some rather lengthy guides and reference docs for my employees and it would be nice to have 'Index Links' within the post so they can jump to the info they need easier.

For now, I am splitting up my guides into multiple posts and have my index links connected to the appropriate post.  This definitely works, but it might be nicer to have it all in a single post...
  
Back to top
WWWYIM  
IP Logged
 
Captain John
Senior Member
****
Offline


Pass to Port !

Posts: 264
Location: Reno Beach
Joined: Jan 18th, 2007
Gender: Male
Re: Internal Links and Anchors Y22 0.1b
Reply #6 - Apr 7th, 2010 at 3:08pm
Print Post  
try it ... lots of older MODs work with the Newer YaBB versions .. without upgrading the MOD.
   Sometimes it is just a simple correction to the search string (where to place the New code) is all that needed to install.
  

Love to live and love on the water
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint