vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Coding Help - Social Networks (https://vborg.vbsupport.ru/showthread.php?t=246178)

merk_aus 07-09-2010 01:53 AM

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.

KevinL 07-09-2010 02:13 AM

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>


merk_aus 07-09-2010 02:45 AM

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.

KevinL 07-09-2010 02:53 AM

I forgot the vb: after all the images I made them just if statements. Sorry

merk_aus 07-09-2010 03:14 AM

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}


All times are GMT. The time now is 10:36 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.01038 seconds
  • Memory Usage 1,725KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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