vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   "My Links" Menu (https://vborg.vbsupport.ru/showthread.php?t=155548)

Digital Jedi 08-18-2007 06:36 AM

"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?

Digital Jedi 08-20-2007 08:38 PM

No suggestions so far? What I want to do can't be that complicated, can it?

Digital Jedi 08-23-2007 04:11 PM

I figure it can't hurt to bump this one last time. Maybe someone can just point me in the right direction.

blind-eddie 07-11-2008 12:57 PM

I sure hope you figure it out, I have been trying to do this very same thing.

Digital Jedi 07-13-2008 01:25 AM

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.

Boosted Panda 07-13-2008 01:49 AM

Hope you get it working Jedi. I have it on my Postbit but there is some issues with spacing and what not.

Opserty 07-13-2008 07:11 AM

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).

Digital Jedi 07-14-2008 09:26 AM

Quote:

Originally Posted by Opserty (Post 1574046)
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.


All times are GMT. The time now is 03:37 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.01078 seconds
  • Memory Usage 1,738KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete