YaBB Community and Support Forum
YaBB Home About YaBB Download YaBB YaBB Support Customize Your Forum Development Contribute to the Project
  Welcome, Guest. Please Login or Register


 
Page Index Toggle Pages: 1
Topic Tools
 
Add [thread] and [post] tags to YaBBC (Read 2,687 times)
 May 20th, 2009 at 11:22pm
There are no actions to perform.  

cepheid 
Senior Member
****
Offline
Posts: 516


None
Add [thread] and [post] tags to YaBBC
Right now there is no "automated" way to link to certain threads or posts - we must manually copy the URL to that thread/post and use an [url] tag.  Some other forum software provides [thread] and [post] tags for this purpose, to provide the linking capability automatically.

I'd like to request those tags in YaBB, as well.  The preferred format would be, for example:
[thread]threadid[/thread] <--- autolinks to thread and auto-inserts thread subject (retrieved from thread file) as link text

[thread=threadid]link text[/thread] <-- like [url], but auto-links to thread based on threadid

[post]postid[/post] <-- as above, but auto-links to specific post... not sure what the automatic link text would be.

[post=postid]link text[/post] <-- as above, but links to post
Implementing the [thread] tag should be fairly easy; the [post] tag would be a bit more difficult since posts are generally indexed by their position within a thread, so a possible syntax would be postid == threadid/postnum, which YaBB would then parse and turn into the proper post link.  (Parsing this should be pretty easy since something similar is already done by the quoteSelection() javascript function.)
 
WWW  
IP Logged  
 Reply #1 - May 25th, 2009 at 10:38am
There are no actions to perform.  

deti 
Legacy Dev Team
Development Team
****
Offline
Posts: 2,650
Prien am Chiemsee, Germany


None
Re: Add [thread] and [post] tags to YaBBC
Hmmm, I can't see any advantage in using thread or post instead of url tags Huh
What do you mean with autolinks??
 
Was immer Du tun kannst
oder erträumst tun zu können,
beginne es.
Kühnheit besitzt Genie,
Macht und magische Kraft.
Beginne es jetzt.
Whatever you can do
or dream you can,
begin it.
Boldness has genius,
power and magic in it.
Begin it now.
J. W. Goethe
WWW  
IP Logged  
 Reply #2 - May 25th, 2009 at 10:47am
There are no actions to perform.  

cepheid 
Senior Member
****
Offline
Posts: 516


None
Re: Add [thread] and [post] tags to YaBBC
What I mean is that someone enters something like:
[thread=12345]look at this thread[/thread]

And YaBB parses it to turn it into:
look at this thread

So, YaBB turns the [thread] tag into an [url] tag automatically, filling in the appropriate details.

The advantage to this is that all a user has to enter is the thread id, not the entire URL.

This is something I use a lot on vBulletin... that doesn't mean YaBB has to have it, of course!  But, it would be nice, in my opinion.  I know lots of vB users use it, and I think YaBB users would, too.
« Last Edit: May 25th, 2009 at 10:48am by cepheid »  
WWW  
IP Logged  
 Reply #3 - May 25th, 2009 at 11:01am
There are no actions to perform.  

deti 
Legacy Dev Team
Development Team
****
Offline
Posts: 2,650
Prien am Chiemsee, Germany


None
Re: Add [thread] and [post] tags to YaBBC
Hmmm, maybe some day ... every additional RegEx is extra work when parsing each message.

At least for me it's easier to copy the URL from the browser address line because it is marked at all when I click in the field. It would be more to do if I had to only mark the number before I copy it and this can make more errors too if you forget the first or last number.
 
Was immer Du tun kannst
oder erträumst tun zu können,
beginne es.
Kühnheit besitzt Genie,
Macht und magische Kraft.
Beginne es jetzt.
Whatever you can do
or dream you can,
begin it.
Boldness has genius,
power and magic in it.
Begin it now.
J. W. Goethe
WWW  
IP Logged  
 Reply #4 - May 25th, 2009 at 12:42pm
There are no actions to perform.  
Carsten 
Ex Member


None
Re: Add [thread] and [post] tags to YaBBC
Why not ues what we already have. With very small changes it's possible to use the "URL" yabbc button:

Code removed - see reply #10

This will give you the same options as when inserting complete url - except that you'll have to use the URL button to insert topic/post id.
« Last Edit: May 26th, 2009 at 9:17pm by N/A »  
 
IP Logged  
 Reply #5 - May 25th, 2009 at 12:46pm
There are no actions to perform.  

cepheid 
Senior Member
****
Offline
Posts: 516


None
Re: Add [thread] and [post] tags to YaBBC
Carsten, thanks for the code.  The problem is that it will likely be confusing to users if the [url] tag is used both for regular URLs and for threadid/postid links, because URL has a very specific meaning to most people... hence why I recommended using [thread] and/or [post] for those.

Just my opinion.
 
WWW  
IP Logged  
 Reply #6 - May 25th, 2009 at 12:49pm
There are no actions to perform.  
Carsten 
Ex Member


None
Re: Add [thread] and [post] tags to YaBBC
Hmm - well it's actually the url to that post/topic you want to insert. To me it seems more confusing to have 3 different ways to insert url's  Smiley
 
 
IP Logged  
 Reply #7 - May 25th, 2009 at 1:17pm
There are no actions to perform.  

OH Eng 
Past Team Members
Documentation Team
Offline
Posts: 4,026
Pensacola, Florida USA


None
Re: Add [thread] and [post] tags to YaBBC
I agree with Carsten.  Remember these forums are trying to attract general users who don't use forums.  They need a simple way to tag a post, and making 3 ways is nice for experienced users but makes it seem overwhelming to others.

The 3-different-ways feature might be best added as a MOD.

 
 
OH Eng  
IP Logged  
 Reply #8 - May 25th, 2009 at 7:14pm
There are no actions to perform.  
Carsten 
Ex Member


None
Re: Add [thread] and [post] tags to YaBBC
OH Eng wrote on May 25th, 2009 at 1:17pm:
The 3-different-ways feature might be best added as a MOD.

Just to make sure there's no misunderstanding - the code above does give you all 3 ways - but only using one button (tag) the URL button (tag)  Wink
 
 
IP Logged  
 Reply #9 - May 25th, 2009 at 9:26pm
There are no actions to perform.  

OH Eng 
Past Team Members
Documentation Team
Offline
Posts: 4,026
Pensacola, Florida USA


None
Re: Add [thread] and [post] tags to YaBBC
Yes, I'm saying that's a way I would prefer over having a URL tag, a Post tag, and Thread tag.  It's also confusing to users when you have some tags with an available button and others without one.
« Last Edit: May 25th, 2009 at 9:27pm by OH Eng »  
 
OH Eng  
IP Logged  
 Reply #10 - May 26th, 2009 at 6:54pm
There are no actions to perform.  
Carsten 
Ex Member


None
Re: Add [thread] and [post] tags to YaBBC
OH Eng wrote on May 25th, 2009 at 9:26pm:
Yes, I'm saying that's a way I would prefer over having a URL tag, a Post tag, and Thread tag.  It's also confusing to users when you have some tags with an available button and others without one.  

I knew you'd understand - just wanted to make sure  Wink

To make this complete here's the code to parse the URL tags with only the topic/reply id - making the changes much more simple (replacing the code in reply #4):

In YaBBC.pl find
Code Select All
	$message =~ s~\[url=\s*(.+?)\s*\]\s*(.+?)\s*\[/url\]~&format_url2($1, $2)~eisg; 


and add before
Code Select All
	$message =~ s~(\[url)(\]|=)([\d]{9,10})~$1$2$scripturl?num=$3~isg; 



In yabbc.js find
Code Select All
	ubbcstr=ubbcstr.replace(/\[url\]\s*www\.(\S+?)\s*\[\/url\]/ig, "<a href='http://www.$1' target='_blank'>www.$1</a>"); 


and add before
Code Select All
	ubbcstr=ubbcstr.replace(/(\[url)(\]|\=)([\d]{9,10})/ig, "$1$2" + scriptul + "?num=$3"); 



In ubbc.js find two instances of
Code Select All
		if ( spliturl.length > 1 && (theurl.match(/\S\.\S/)) ) { 


and replace both with
Code Select All
		if ( spliturl.length > 1 && ((theurl.match(/\S\.\S/)) || theurl.match(/[\d]{9,10}/)) ) { 

« Last Edit: May 26th, 2009 at 9:32pm by N/A »  
 
IP Logged  
Page Index Toggle Pages: 1
Topic Tools
 

Get Yet another Bulletin Board at SourceForge.net. Fast, secure and Free Open Source software downloads Support This Project BoardMod - YaBB features and templates YaBB Codex - support on installation and usage YaBB Toolbar for your browser

YaBB Facebook Group Page

Vulnerability Scanner

Valid RSS Valid XHTML Valid CSS Powered by Perl
YaBB Chat and Support Community » Powered by YaBB 3.0 Beta!
YaBB Forum Software © 2000-2011. All Rights Reserved.