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 07-09-2010, 01:53 AM
merk_aus merk_aus is offline
 
Join Date: Feb 2008
Location: Australia
Posts: 582
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Coding Help - Social Networks

Okay,
First of all I apologize my mind has completely shut down on me - too many things happening and not enough sleep - I found a modification for vb3.8 about adding social network links to a postbit however would like it to be updated to vb4.

Below is the code:
Code:
<div align="center">
My Social Networks:<br /><br />
<if condition="is_member_of($bbuserinfo, 2, 6, 7, 9)">
<if condition="$post['field5']">
<a href="https://twitter.com/$post[field5]" target="_blank">
<img alt="Twitter" border="0" src="$stylevar[imgdir_misc]/twitter.png"/></a></if>
&nbsp;&nbsp;
<if condition="$post['field6']">
<a href="https://facebook.com/$post[field6]" target="_blank">
<img alt="Facebook" border="0" src="$stylevar[imgdir_misc]/facebook.png"/></a></if>
&nbsp;&nbsp;
<if condition="$post['field7']">
<a href="https://myspace.com/$post[field7]" target="_blank">
<img alt="MySpace" border="0" src="$stylevar[imgdir_misc]/myspace.png"/></a></if>
</div>
</if>
Are one of the smart, fantastic professional coders out there able to help me update this code to vBulletin 4.0.4 please.

I am working on my postbit stuff at the moment and this would be a great addition.

Thank you to all in advance.
Reply With Quote
  #2  
Old 07-09-2010, 02:13 AM
KevinL KevinL is offline
 
Join Date: Apr 2005
Posts: 1,287
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This should work?

Code:
<div align="center">
My Social Networks:<br /><br />
<vb:if condition="is_member_of($post, 2, 6, 7, 9)">
<vb:if condition="$post['field5']">
<a href="https://twitter.com/$post[field5]" target="_blank">
<img alt="Twitter" border="0" src="$stylevar[imgdir_misc]/twitter.png"/></a></if>
&nbsp;&nbsp;
<vb:if condition="$post['field6']">
<a href="https://twitter.com/$post[field6]" target="_blank">
<img alt="Twitter" border="0" src="$stylevar[imgdir_misc]/facebook.png"/></a></if>
&nbsp;&nbsp;
<vb:if condition="$post['field7']">
<a href="https://twitter.com/$post[field7]" target="_blank">
<img alt="Twitter" border="0" src="$stylevar[imgdir_misc]/myspace.png"/></a></if>
&nbsp;&nbsp;
</div>
</vb:if>
Reply With Quote
  #3  
Old 07-09-2010, 02:45 AM
merk_aus merk_aus is offline
 
Join Date: Feb 2008
Location: Australia
Posts: 582
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the help however it comes up with:
Quote:
The following error occurred when attempting to evaluate this template:
Unclosed Tag
This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.
I will look into it and play with it but thanks for giving me the headstart.
Reply With Quote
  #4  
Old 07-09-2010, 02:53 AM
KevinL KevinL is offline
 
Join Date: Apr 2005
Posts: 1,287
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I forgot the vb: after all the images I made them just if statements. Sorry
Reply With Quote
  #5  
Old 07-09-2010, 03:14 AM
merk_aus merk_aus is offline
 
Join Date: Feb 2008
Location: Australia
Posts: 582
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

lol thanks I sorted it all out and was looking good then realised the links were wrong apparently you cant use $post[field7] or whatever it is so am going to go searching now.

Really thanks for your help though I appreciate it. I have it elsewhere so shouldn't take me long to work this out now my mind is working again

--------------- Added [DATE]1278648986[/DATE] at [TIME]1278648986[/TIME] ---------------

I don't know if this is correct however it got it working on my website and thought I would post it here incase someone else is looking to do the same thing.

For the links I put:
Code:
{vb:raw post.field7}
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 06:49 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.06428 seconds
  • Memory Usage 2,198KB
  • 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
  • (3)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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