vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   working on a new template modification - need help (https://vborg.vbsupport.ru/showthread.php?t=326171)

scottkoz20 03-03-2018 06:42 PM

working on a new template modification - need help
 
I am working on modification that will allow members to link their Facebook Messenger Account to their user profile. I already have the postbit and profile fields set, that was not much of a lift. However, when I try to add information to the memberaction_dropdown, I can't get this to link right

Postbit - Works
Code:

<vb:if condition="$post['fieldxx']"><a href="https://m.me/{vb:raw post.fieldxx}" target="_blank"><img src="images/postbit_social/messenger.png" alt="Contact {vb:raw post.fieldxx} on Messenger" border="" /></a></vb:if>
Member Dropdown - partial works (does not link to the user to message - bold is not working)
Code:

                <li class="left">
                        <a href="https://m.me/{vb:raw post.fieldxx}" target="_blank" class="siteicon_profile">
                                Contact me on Messenger
                        </a>
                </li>


Thoughts?


Thanks,
Scott

MarkFL 03-03-2018 06:54 PM

Try this:

HTML Code:

                <li class="left">
                        <a href="https://m.me/{vb:raw memberinfo.fieldxx}" target="_blank" class="siteicon_profile">
                                Contact me on Messenger
                        </a>
                </li>


scottkoz20 03-03-2018 07:03 PM

that worked... now, I need to make this an if based on the post field

Thanks Mark!

MarkFL 03-03-2018 07:23 PM

I would recommend doing this with a plugin rather than hacking your templates. Create a plugin hooked at "memberaction_dropdown" with the PHP code:

PHP Code:

if ($memberinfo['fieldxx'])
{
    
$template_hook['memberaction_dropdown_items'] .= '<li class="left">
            <a href="https://m.me/' 
$memberinfo['fieldxx'] . '" target="_blank" class="siteicon_profile">
                Contact me on Messenger
            </a>
        </li>'
;



scottkoz20 03-03-2018 07:32 PM

I have a number of hacks already added to the memberaction_dropdown from the past leadership of the site I run now :)

I probably should look at adding them all as plug-ins at some point. :)

when I write-up the modificaiton, can I add the plug-in to the details (with you as a co-author)?

MarkFL 03-03-2018 07:35 PM

Sure, anything I post as a suggestion in a thread can be used freely. While I appreciate the citation as co-author, it's not necessary. :)

scottkoz20 03-03-2018 10:04 PM

published


https://vborg.vbsupport.ru/showthread.php?t=326172


All times are GMT. The time now is 04:04 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.01236 seconds
  • Memory Usage 1,730KB
  • 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_html_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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