The BoardMod Project
 The Project | News | Downloads | Mods | FAQ | Templates | Chat | Forum
BoardMod Support Forum
[ Home | Help | Search | Login | Register ]  

26.05.13 at 03:28:47, Welcome, Guest. Please Login or Register

Choose Language:
Page Index Toggle Pages: 1
Internal Links and Anchors Y22 0.1b (Read 4590 times)
Curtiss Grymala
Hacker God
*****
Offline

Posts: 1314



16.11.07 at 01:46:45  
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:
[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:
[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
 
IP Logged
 

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
Cable
Hacker Wannabe
**
Offline

Posts: 97



Reply #1 - 30.11.07 at 21:51:48  
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!










                       
 
IP Logged
 
Cable
Hacker Wannabe
**
Offline

Posts: 97



Reply #2 - 01.12.07 at 11:17:26  
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:
<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:
<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:
<find>

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

<replace with>

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

# expands width to allow for 2 more icons



Code:
<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.


 
IP Logged
 
mattcch
Bloody Novice
*
Offline

Posts: 45



Reply #3 - 29.12.07 at 01:01:45  
Compelling mod, and it is very good for long essay or  posted article.Awesome.Works ok after installed.  Smiley
 
IP Logged
 
Curtiss Grymala
Hacker God
*****
Offline

Posts: 1314



Reply #4 - 09.01.08 at 00:55:26  
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.
 
IP Logged
 

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
KingDutka
Hacker Wannabe
**
Offline

Posts: 91



Reply #5 - 07.04.10 at 00:47:58  
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...
 
IP Logged
 
Captain John
Hacker Expert
****
Offline

Reno Beach, Ohio, USA
Posts: 264



Reply #6 - 07.04.10 at 16:08:48  
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.
 
IP Logged
 

Love to live and love on the water
Page Index Toggle Pages: 1
© 2000-2012 by - All rights reserved.

Project website hosting proudly sponsored and provided by UK2 Hosting
 The Project | News | Downloads | Mods | FAQ | Templates | Chat | Forum