Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-18-2007, 06:36 AM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default "My Links" Menu

This Mod put a drop down menu in the navbar with a list of custom links defined by whatever a user puts in one of his/her Custom Profile Fields. Our users really liked this addition on 3.0, but it needs to be modified to work with 3.6.

The problem, I'm told, is that it uses the php_include template, which is now controlled by the global_start hook. Not to mention, bbcode is parsed differently now.

Okay, I'm halfway certain I understand all of that. Let's presume I do. <twitch> So what I think I need to do is create a plugin that correctly gives $mylinks meaning. If that's the case, am I going in the right direction with plugin code below? It obviously doesn't work, but I'd like to know if I'm even on the right track, or just wasting my time. And if so, what wil make this work for 3.6?

PHP Code:
require_once(DIR '/includes/class_bbcode.php');
 
$parser =& new vB_BbCodeParser($vbulletinfetch_tag_list());
 
$mylinks $parser->do_parse($userinfo['field5']);  
    
$mylinks str_replace('<br />'''$mylinks); 
    
$mylinks str_replace('</a>''</a></td></tr>'$mylinks); 
    
$mylinks str_replace('<a''<tr><td class="vbmenu_option"><a'$mylinks); 
I removed the if conditions simply because they weren't working either. They just made the link invisible, but with that said, I'm going to need to know how to make them work right too. To be fair, this is like the hundredth variation I've tried after reading about 3 different ways to parse BBCode. But I can't even get content to show in the drop down menu. It tries to open, but since there's no <tr><td> tags, it shows nothing. I know everyone says it, but any help would genuinely be appreciated. This will eat at me, until I can make it work. And I really need to sleep.

...

What twitch?
Reply With Quote
  #2  
Old 08-20-2007, 08:38 PM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No suggestions so far? What I want to do can't be that complicated, can it?
Reply With Quote
  #3  
Old 08-23-2007, 04:11 PM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I figure it can't hurt to bump this one last time. Maybe someone can just point me in the right direction.
Reply With Quote
  #4  
Old 07-11-2008, 12:57 PM
blind-eddie's Avatar
blind-eddie blind-eddie is offline
 
Join Date: Apr 2006
Location: Michigan
Posts: 2,310
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I sure hope you figure it out, I have been trying to do this very same thing.
Reply With Quote
  #5  
Old 07-13-2008, 01:25 AM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Afraid I haven't. I'm fairly certain it can be done with a plugin. I just don't know enough about them to hound dog a way to do it yet.
Reply With Quote
  #6  
Old 07-13-2008, 01:49 AM
Boosted Panda Boosted Panda is offline
 
Join Date: Mar 2008
Location: Long Beach, CA
Posts: 262
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hope you get it working Jedi. I have it on my Postbit but there is some issues with spacing and what not.
Reply With Quote
  #7  
Old 07-13-2008, 07:11 AM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why do you need to invoke the BBCode Parser?

Simply create a User Field with a textarea. Have users input it like:
Code:
LinkName|LinkURL
LinkName2|LinkURL2
  1. When it comes to display time explode() the userfield by a newline "\n" (double quotes important here).
  2. trim() the output (use array_map() if you need to).
  3. Then explode() each line again by a '|'.
  4. Run a regex check on the LinkURL (to make sure its valid)
  5. Finally, run LinkName through htmlspecialchars() (or the vB function htmlspecialchars_uni()).
Information on each function can be found on php.net. (Just type in http://php.net/function_name in your browser or use the search feature on their site).
Reply With Quote
  #8  
Old 07-14-2008, 09:26 AM
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 Opserty View Post
Why do you need to invoke the BBCode Parser?

Simply create a User Field with a textarea. Have users input it like:
Code:
LinkName|LinkURL
LinkName2|LinkURL2
  1. When it comes to display time explode() the userfield by a newline "\n" (double quotes important here).
  2. trim() the output (use array_map() if you need to).
  3. Then explode() each line again by a '|'.
  4. Run a regex check on the LinkURL (to make sure its valid)
  5. Finally, run LinkName through htmlspecialchars() (or the vB function htmlspecialchars_uni()).
Information on each function can be found on php.net. (Just type in http://php.net/function_name in your browser or use the search feature on their site).
In the old modification, the URL, THREAD and POST tags could be used to link without neccesarily opening all the links in a new window.
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 01:27 AM.


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.03843 seconds
  • Memory Usage 2,239KB
  • 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
  • (2)bbcode_code
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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_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