Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-07-2010, 11:58 AM
derdiedastim derdiedastim is offline
 
Join Date: Sep 2006
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Create a anchor

Hi,
it is possible to create an bbcode for anchor in vB 4?

In vB 3 I create an bbcode like this:
HTML Code:
<a href="#{option}">{param}</a>
But this doesn't work with vB 4. I think it is because of the "base"-tag in the source-Code.

Any ideas? Hacks/Mods?
Reply With Quote
  #2  
Old 05-28-2010, 02:33 AM
mariobkk mariobkk is offline
 
Join Date: Apr 2006
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I try to create anchors as well, but it doesn't work. When clicking on the anchor link I get redirected to the starting page of CMS, but not the anchor point within the post.

I created custom BB Codes as follows already, but it doesn't work:

Title: Anchor link
Tag: jumpto
Replacement: <a href="#{option}">{param}</a>
Example: [jumpto=aname]This takes you to a new location within a post[/jumpto]
Description: The [jumpto] tag allows you to jump to another location within a post, usually used for long posts with headings and/or sections of interest. This tag <b>must</b> be used in conjunction with the [aname] tag. One is not functional without the other.
Use {option}: Yes
Click Save

Title: Named anchor link
Tag: aname
Replacement: <a name="{option}">{param}</a>
Example: [aname=aname]This is where you jump to[/aname]
Description: The [aname] tag is used in conjunction with the <a href="#jumpto">[jumpto]</a> tag. One is not functional without the other.
Use {option}: Yes
Click Save

Any help would be highly appreciated.

Thank you
Reply With Quote
  #3  
Old 01-14-2011, 07:38 PM
scarex scarex is offline
 
Join Date: Aug 2006
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did anyone find a solution to this problem?
Reply With Quote
  #4  
Old 01-14-2011, 08:16 PM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by derdiedastim View Post
Hi,
it is possible to create an bbcode for anchor in vB 4?

In vB 3 I create an bbcode like this:
HTML Code:
<a href="#{option}">{param}</a>
But this doesn't work with vB 4. I think it is because of the "base"-tag in the source-Code.
This is not an actual anchor. This will create a link to an anchor, and only within the same page. Look at your herf attribute. If you don't put anything but #{option} then it's just going to look for the anchor name on the same page. It would need to include the URL of the page the anchor is on to do go somewhere else. Really, you don't need special BBCode for that. Just link to your anchor the way you would normally.

But like I said, you need an anchor to link to. You would need BBCode that creates the actual anchor name you want to link to, not the other way around.

Code:
<a name="{option}">{param}</a>
So you'd make a post that has the anchor in it. Let's say you named the BBcode ANCHOR.

Code:
[ANCHOR="tips"]Useful Tips[/ANCHOR]
Then when you want to link to that anchor, you just post a normal link with the anchor appended to the end of the URL.

Code:
http://www.yoursite.com/showthread.php?t=threadid123456#tips
That's it. You really only need one BBCode.


Quote:
Originally Posted by mariobkk View Post
I try to create anchors as well, but it doesn't work. When clicking on the anchor link I get redirected to the starting page of CMS, but not the anchor point within the post.

I created custom BB Codes as follows already, but it doesn't work:

Title: Anchor link
Tag: jumpto
Replacement: <a href="#{option}">{param}</a>
Example: [jumpto=aname]This takes you to a new location within a post[/jumpto]
Description: The [jumpto] tag allows you to jump to another location within a post, usually used for long posts with headings and/or sections of interest. This tag <b>must</b> be used in conjunction with the [aname] tag. One is not functional without the other.
Use {option}: Yes
Click Save



Title: Named anchor link
Tag: aname
Replacement: <a name="{option}">{param}</a>
Example: [aname=aname]This is where you jump to[/aname]
Description: The [aname] tag is used in conjunction with the <a href="#jumpto">[jumpto]</a> tag. One is not functional without the other.
Use {option}: Yes
Click Save

Any help would be highly appreciated.

Thank you
I don't know where you got these, but you don't need the href one, the one that creates links. You can just link to the anchor normally. Just like I said above, the link you're creating would only link to an anchor if happens to be on the same page as the link.
Reply With Quote
  #5  
Old 01-16-2011, 11:46 AM
scarex scarex is offline
 
Join Date: Aug 2006
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Digital Jedi View Post
This is not an actual anchor. This will create a link to an anchor, and only within the same page. Look at your herf attribute. If you don't put anything but #{option} then it's just going to look for the anchor name on the same page. It would need to include the URL of the page the anchor is on to do go somewhere else. Really, you don't need special BBCode for that. Just link to your anchor the way you would normally.

But like I said, you need an anchor to link to. You would need BBCode that creates the actual anchor name you want to link to, not the other way around.

Code:
<a name="{option}">{param}</a>
So you'd make a post that has the anchor in it. Let's say you named the BBcode ANCHOR.

Code:
[ANCHOR="tips"]Useful Tips[/ANCHOR]
Then when you want to link to that anchor, you just post a normal link with the anchor appended to the end of the URL.

Code:
http://www.yoursite.com/showthread.php?t=threadid123456#tips
That's it. You really only need one BBCode.



I don't know where you got these, but you don't need the href one, the one that creates links. You can just link to the anchor normally. Just like I said above, the link you're creating would only link to an anchor if happens to be on the same page as the link.
I Digital Jedi,
I'm using 4.01 PL2 vbulletin, and the problem in using url bbcode referring to an anchor is that the resulting hyperlink in href is something similar to http:///#<anchor-name> that's obviously doesn't work.
Instead, creating an alternative bbcode, which doesn't add "https://", the problem is that browser will redirect to site home page.
Reply With Quote
  #6  
Old 01-16-2011, 02:19 PM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by scarex View Post
I Digital Jedi,
I'm using 4.01 PL2 vbulletin, and the problem in using url bbcode referring to an anchor is that the resulting hyperlink in href is something similar to http:///#<anchor-name> that's obviously doesn't work.
Instead, creating an alternative bbcode, which doesn't add "https://", the problem is that browser will redirect to site home page.
Well, obviously if the page isn't https it wont find the page. But I don't see why the other shouldn't be working. I just tried it on my 4.0.1 test board and it worked perfectly. Remember that the BBCode that you posted in the first post will not do what you wanted. You need to use the one I posted
Reply With Quote
  #7  
Old 01-16-2011, 08:21 PM
scarex scarex is offline
 
Join Date: Aug 2006
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Digital Jedi View Post
Well, obviously if the page isn't https it wont find the page. But I don't see why the other shouldn't be working. I just tried it on my 4.0.1 test board and it worked perfectly. Remember that the BBCode that you posted in the first post will not do what you wanted. You need to use the one I posted
I've posted no bbcode in this thread.... anyway your bbcode works good as you are suggesting to use a normale url bbcode where you specificy the entire target url + anchor.
This suggests that I've to post the article, catch the url and then edit it adding the correct reference. Not so friendly...

Instead, I've already the anchor bbcode which place anchor target, but as I said if I use the normal url bbcode with #<anchor-name> as target, engine adds http://

Anyway, thank you
Reply With Quote
  #8  
Old 01-16-2011, 10:41 PM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry, I thought you were the OP.

So your saying, you're trying to put anchors in posts that you haven't posted yet? I presume you're only trying to link to anchors on the same page, because without the full URL, that's all you'd ever be able to do. I've can't a BBCode like that to work, but for different reasons. The one being that it always tries to use my forum URL, rather than the thread I'm on. That's normally the way it should work, though.
Reply With Quote
  #9  
Old 01-17-2011, 07:01 AM
scarex scarex is offline
 
Join Date: Aug 2006
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Digital Jedi View Post
Sorry, I thought you were the OP.

So your saying, you're trying to put anchors in posts that you haven't posted yet? I presume you're only trying to link to anchors on the same page, because without the full URL, that's all you'd ever be able to do. I've can't a BBCode like that to work, but for different reasons. The one being that it always tries to use my forum URL, rather than the thread I'm on. That's normally the way it should work, though.
You're right, my problem is exactly this.

People in our staff who write CMS articles need to use anchor in the same text, in order to refer to different part of the text. I can say them to save the article, catch the url and edit it again putting the correct reference, but I'm figuring out if there was a more friendly mechanism. However, even if without "http://" in front of anchor name, browser redirect on site home page and I don't understand why....
Reply With Quote
  #10  
Old 07-28-2012, 12:05 AM
sub_ubi sub_ubi is offline
 
Join Date: Dec 2004
Posts: 177
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Fix for VB 4 is here in the original thread https://vborg.vbsupport.ru/showpost....14&postcount=3
Reply With Quote
Reply


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


All times are GMT. The time now is 05:44 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04623 seconds
  • Memory Usage 2,267KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (6)bbcode_code
  • (2)bbcode_html
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete