Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) Link to This Topic V1.1a for YaBB 2.4 (Read 9847 times)
Derek Barnstorm
God Member
*****
Offline



Posts: 1146
Location: Warwickshire
Joined: Mar 23rd, 2008
Gender: Male
Link to This Topic V1.1a for YaBB 2.4
Sep 1st, 2009 at 10:30pm
Print Post  
Link to This Topic V1.1a

Description:
---------------
This Mod will add a 'Link to This Topic' box below threads in Message View (see screenshot), allowing users to click and copy the URL to a thread in HTML Code, BBCode, URL and Permalink (if enabled).

Note: After intallation, you need to enable this feature in 'Admin Center - Forum Settings - Show / Hide Items'.

Credits:
----------
Thanks to Mick (www.info4alien.de) for the German and German_Du Language translations.

Screenshots:
-----------------
Message Display:


Admin Center - Forum Settings - Show / Hide Items


Installation:
---------------
Modify YaBB files using BoardMod or manually.
Upload modified files to your server in ASCII mode.  

Files to edit:
----------------
Admin/ManageTemplates.pl
Admin/ModList.pl
Admin/NewSettings.pl
Admin/Settings_Main.pl
Sources/Display.pl
Templates/default/Display.template
Templates/yabb21/Display.template

Zip package:
----------------
Link_to_This_Topic_V1_1a.mod
cgi-bin/yabb2/Languages/English/LinkTopic.lng
cgi-bin/yabb2/Languages/German/LinkTopic.lng
cgi-bin/yabb2/Languages/German_Du/LinkTopic.lng

History:
----------
1.0 - First Release - 1st September 2009
1.1 - Fixed issue with unwanted '&' symbols appearing with some peoples servers (Thanks to Carsten for pointing out the fix!) - 7th January 2010
1.1a - Fixed YaBB tag displaying in Template Configuration - 8th January 2010
« Last Edit: Jan 12th, 2010 at 4:16pm by Derek Barnstorm »  

Link_to_This_Topic_V_1_1a.zip ( 5 KB | Downloads )
Back to top
 
IP Logged
 
batchman
Global Moderator
*****
Offline


What's up?!

Posts: 1280
Location: Orlando
Joined: Apr 28th, 2002
Gender: Male
Re: Link to This Topic V1.0 for YaBB 2.4
Reply #1 - Jan 1st, 2010 at 9:57pm
Print Post  
I've given this a try, and for the most part it works, but in the HTML and BBC code versions, there are '&' thrown in where they don't belong. Any ideas on where they might be coming from?

(for example,
Code
Select All
<a href="http://jonbatchelor.com/cgi-bin/yabb2/YaBB.pl?num=1262317955"& target="&_blank"&>&Random Page of Random Tests<&/a>& 



The straight URL option comes out fine, though.
  

Improving my forum, one mod at a time!


Now up and running again, with an accurate link.


Back to top
WWW  
IP Logged
 
Captain John
Senior Member
****
Offline


Pass to Port !

Posts: 264
Location: Reno Beach
Joined: Jan 18th, 2007
Gender: Male
Re: Link to This Topic V1.0 for YaBB 2.4
Reply #2 - Jan 2nd, 2010 at 2:38am
Print Post  
  

Love to live and love on the water
Back to top
 
IP Logged
 
Derek Barnstorm
God Member
*****
Offline



Posts: 1146
Location: Warwickshire
Joined: Mar 23rd, 2008
Gender: Male
Re: Link to This Topic V1.0 for YaBB 2.4
Reply #3 - Jan 7th, 2010 at 1:09am
Print Post  
Are you still having problems with this Batchman?
  
Back to top
 
IP Logged
 
batchman
Global Moderator
*****
Offline


What's up?!

Posts: 1280
Location: Orlando
Joined: Apr 28th, 2002
Gender: Male
Re: Link to This Topic V1.0 for YaBB 2.4
Reply #4 - Jan 7th, 2010 at 7:15am
Print Post  
Yeah ... maybe Captain John is right and it has to do with the slight code change that keeps my host from blocking the forum because it doesn't like getting too many &'s in urls, but somehow I still get lots of extra &'s in the first two options.
  

Improving my forum, one mod at a time!


Now up and running again, with an accurate link.


Back to top
WWW  
IP Logged
 
Derek Barnstorm
God Member
*****
Offline



Posts: 1146
Location: Warwickshire
Joined: Mar 23rd, 2008
Gender: Male
Re: Link to This Topic V1.1 for YaBB 2.4
Reply #5 - Jan 7th, 2010 at 6:20pm
Print Post  
Okay, should be fixed now. V1.1 attached to the first post.

Thanks to Carsten for pointing out the fix!
  
Back to top
 
IP Logged
 
batchman
Global Moderator
*****
Offline


What's up?!

Posts: 1280
Location: Orlando
Joined: Apr 28th, 2002
Gender: Male
Re: Link to This Topic V1.1 for YaBB 2.4
Reply #6 - Jan 7th, 2010 at 8:17pm
Print Post  
Yup ... installed the new version, and it avoids the extra &'s.

Thanks!
  

Improving my forum, one mod at a time!


Now up and running again, with an accurate link.


Back to top
WWW  
IP Logged
 
Derek Barnstorm
God Member
*****
Offline



Posts: 1146
Location: Warwickshire
Joined: Mar 23rd, 2008
Gender: Male
Re: Link to This Topic V1.1a for YaBB 2.4
Reply #7 - Jan 8th, 2010 at 5:30pm
Print Post  
Fixed the YaBB tag displaying in Template Configuration. V1.1a attached to the first post.

If you've already installed the Mod, you only need to upload Admin/ManageTemplates.pl.
  
Back to top
 
IP Logged
 
mick
Senior Member
****
Offline


I love YaBB

Posts: 345
Location: Dorsten
Joined: Nov 29th, 2005
Gender: Male
Re: Link to This Topic V1.1a for YaBB 2.4
Reply #8 - Jan 12th, 2010 at 9:24am
Print Post  
Hi,

installed without Problems, runs well. Thanks for this Mod!

German-Files attached*. You can add them to 1st Post, Derek.


* Deleted. They are now in the Package of 1st Post
« Last Edit: Jan 12th, 2010 at 4:25pm by mick »  
Back to top
WWW  
IP Logged
 
Derek Barnstorm
God Member
*****
Offline



Posts: 1146
Location: Warwickshire
Joined: Mar 23rd, 2008
Gender: Male
Re: Link to This Topic V1.1a for YaBB 2.4
Reply #9 - Jan 12th, 2010 at 4:18pm
Print Post  
Hi Mick,

Thank you very much! I've added them to the package.
  
Back to top
 
IP Logged
 
batchman
Global Moderator
*****
Offline


What's up?!

Posts: 1280
Location: Orlando
Joined: Apr 28th, 2002
Gender: Male
Re: Link to This Topic V1.1a for YaBB 2.4
Reply #10 - Jan 23rd, 2010 at 11:51pm
Print Post  
If the thread title has an apostrophe in it, it screws up the links.
  

Improving my forum, one mod at a time!


Now up and running again, with an accurate link.


Back to top
WWW  
IP Logged
 
Derek Barnstorm
God Member
*****
Offline



Posts: 1146
Location: Warwickshire
Joined: Mar 23rd, 2008
Gender: Male
Re: Link to This Topic V1.1a for YaBB 2.4
Reply #11 - Jan 24th, 2010 at 3:01am
Print Post  
Err, I'm too sure the best solution for this. To fix your problem with the '&' symbol the value was put into single quotes, so if there's an apostrophe in the subject it's going to break it.

The only way I can think to do it at the minute is to replace the apostrophe with '&apos;', but I've got a feeling that this might cause you problems with the '&' symbol again.

If you could give it a go though and let me how it works...

In Sources/Display.pl find:

Code
Select All
if (!$movedflag && $show_link_topic) { 


And add this after:

Code
Select All
$msubthread =~ s/'/&apos;/g; 


If you could test it with a thread with more than one apostrophe too. But as I say, I think this might cause you problems again - if it does, I'll have to have another rethink...
« Last Edit: Jan 24th, 2010 at 4:12am by Derek Barnstorm »  
Back to top
 
IP Logged
 
batchman
Global Moderator
*****
Offline


What's up?!

Posts: 1280
Location: Orlando
Joined: Apr 28th, 2002
Gender: Male
Re: Link to This Topic V1.1a for YaBB 2.4
Reply #12 - Jan 24th, 2010 at 3:29am
Print Post  
I gave it a try, and it caused the title of the thread to be displayed as @apos; whereever it was shown, both in the display of the thread posts, and in your mod's links.

So this one may need a different solution, or just a note that it doesn't work perfectly when apostrophes are used in thread titles. (It's not the only place where apostrophes cause problems in YaBB.)
  

Improving my forum, one mod at a time!


Now up and running again, with an accurate link.


Back to top
WWW  
IP Logged
 
Derek Barnstorm
God Member
*****
Offline



Posts: 1146
Location: Warwickshire
Joined: Mar 23rd, 2008
Gender: Male
Re: Link to This Topic V1.1a for YaBB 2.4
Reply #13 - Jan 24th, 2010 at 3:56am
Print Post  
Ah, okay. Thanks for testing anyway - I'll have to have a think about it and see if I can come up with something else.

batchman wrote on Jan 24th, 2010 at 3:29am:
it caused the title of the thread to be displayed as @apos; whereever it was shown, both in the display of the thread posts, and in your mod's links.

Oops! I don't think it will fix your problem, but to only change the apostrophe in the links, you would have to do this:

Find:
Code
Select All
if (!$movedflag && $show_link_topic) { 


Add after:
Code
Select All
$topicsub = $msubthread;
$topicsub =~ s/'/&apos;/g; 


Then in this bit change the highlighted '$msubthread':

Code
Select All
		<td width="15%" class="windowbg2"><label for="link_html"><b>$link_topic_txt{'02'}:</b></label></td>
		<td class="windowbg2"><input type="text" id="link_html" style="width: 98%" onclick="this.select();" value='\<a href="$scripturl?num=$mnum" target="_blank"\>$msubthread\</a\>' title="$link_topic_txt{'06'}" readonly="readonly" /></td>
	  </tr>
	  <tr>
		<td width="15%" class="windowbg2"><label for="link_bbcode"><b>$link_topic_txt{'03'}:</b></label></td>
		<td class="windowbg2"><input type="text" id="link_bbcode" style="width: 98%" onclick="this.select();" value='\[url=$scripturl?num=$mnum\]$msubthread\[/url\]' title="$link_topic_txt{'07'}" readonly="readonly" /></td>
	  </tr> 


To '$topicsub':

Code
Select All
		<td width="15%" class="windowbg2"><label for="link_html"><b>$link_topic_txt{'02'}:</b></label></td>
		<td class="windowbg2"><input type="text" id="link_html" style="width: 98%" onclick="this.select();" value='\<a href="$scripturl?num=$mnum" target="_blank"\>$topicsub\</a\>' title="$link_topic_txt{'06'}" readonly="readonly" /></td>
	  </tr>
	  <tr>
		<td width="15%" class="windowbg2"><label for="link_bbcode"><b>$link_topic_txt{'03'}:</b></label></td>
		<td class="windowbg2"><input type="text" id="link_bbcode" style="width: 98%" onclick="this.select();" value='\[url=$scripturl?num=$mnum\]$topicsub\[/url\]' title="$link_topic_txt{'07'}" readonly="readonly" /></td>
	  </tr> 


Don't think that will make any difference at all though.
  
Back to top
 
IP Logged
 
Derek Barnstorm
God Member
*****
Offline



Posts: 1146
Location: Warwickshire
Joined: Mar 23rd, 2008
Gender: Male
Re: Link to This Topic V1.1a for YaBB 2.4
Reply #14 - Jan 24th, 2010 at 8:50pm
Print Post  
Batchman, a quick fix for now would be to just remove the apostrophe form the links. It's not ideal, but it's the only thing I can think of doing.

Follow the instructions in the post above, but in the first step add this after:

Code
Select All
$topicsub = $msubthread;
$topicsub =~ s/'//g; 


Instead of this (so just remove the highlighted):

Code
Select All
$topicsub = $msubthread;
$topicsub =~ s/'/&apos;/g; 


I think what I'm going to have to do is have two different mod files - one for people who don't have problems with the '&' symbol displaying and another for people who do.

Clutching at straws you could try this, but I'm pretty sure it will output the same as it has been doing for you.

Code
Select All
$topicsub = $msubthread;
$topicsub =~ s/'/\&\#39\;/g; 


Sorry, I'm afraid I can't think of another solution other than having two different mod files. Undecided
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint