PDA

View Full Version : Module: Add To My Yahoo


58sniper
09-23-2004, 11:38 PM
This module will contain a link that, when clicked, will add the RSS feed to the users' MyYahoo page.

The module checks for a couple of things via some conditionals. First, it checks to make sure you have the external feeds enabled (AdminCP>vBulletin Options>External Data Provider>Enable RSS Syndication). Then, it checks to see if the current user has @yahoo in their email address. If both conditions pass, it displays the module.

However, in order for this to work, we need to tweak one file first.

Open $vboptions[bburl]/includes/adminfunctions_template.php
find:

'is_member_of', // function to check if $user is member of $usergroupid


under that, paste

'strpos', // for checking


Then, create a new module, 'adv_portal_add2yahoo', that contains

<if condition="$vboptions[externalrss]">
<if condition="strpos($bbuserinfo['email'], '@yahoo')">
<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<thead>
<tr>
<td class="tcat smallfont" style="font-weight: bold; border-top: 0px;"><a style="float: $stylevar[right]" href="#" onclick="return toggle_collapse('forumhome_$mods[filename]')"><img id="collapseimg_forumhome_$mods[filename]" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_forumhome_randomtopic].gif" width="15" height="15" border="0" alt="Collapse/Expand" /></a>$vba_options[portal_blockbullet] $mods[title]</td>
</tr>
</thead>
<tfoot style="display: none;"><tr><td></td></tr></tfoot>
<tbody id="collapseobj_forumhome_$mods[filename]">
<tr style="$vbcollapse[collapseobj_forumhome_randomtopic]">
<td class="$getbgrow smallfont">
If you use the MyYahoo page, and would like to have the latest $vboptions[bbtitle] news appear there, you can<br /><center><a href="http://add.my.yahoo.com/rss?url=$vboptions[bburl]/external.php?type=RSS2"><img src="$stylevar[imgdir_misc]/addtomyyahoo2.gif" width="100" height="14" border="0" alt="" /></a></center>
</td>
</tr>
</tbody>
</table>
<br />
</if>
</if>


Toss the attached addtomyyahoo.gif file in your $vboptions[bburl]/images/misc folder.

Add the module to CMPS
Title: Add To My Yahoo
File: none
OR Template: addtomyyahoo
Active: yes
Column: right or left

That's it. The site I've got this on is still under development, so I can't show you a live demo. The screen shot will have to do.

Keep in mind that this is for a collapsible module. If you need a standard module, let me know.

Incidentally, you could put this anywhere, not just in a standalone module. Adapt to your own needs. I'd be interested to see some variations.

TeamRocket
12-19-2004, 05:34 PM
I think I can improve on your method a little

If instead of having it rely on someone having a yahoo e-mail but instead have it to check if they have Yahoo! IM too, do this:
<if condition="$vboptions[externalrss]">
<if condition="strpos($bbuserinfo['email'], '@yahoo')||isset($bbuserinfo['yahoo'])">
<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<thead>
<tr>
<td class="tcat smallfont" style="font-weight: bold; border-top: 0px;"><a style="float: $stylevar[right]" href="#" onclick="return toggle_collapse('forumhome_$mods[filename]')"><img id="collapseimg_forumhome_$mods[filename]" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_forumhome_randomtopic].gif" width="15" height="15" border="0" alt="Collapse/Expand" /></a>$vba_options[portal_blockbullet] $mods[title]</td>
</tr>
</thead>
<tfoot style="display: none;"><tr><td></td></tr></tfoot>
<tbody id="collapseobj_forumhome_$mods[filename]">
<tr style="$vbcollapse[collapseobj_forumhome_randomtopic]">
<td class="$getbgrow smallfont">
If you use the MyYahoo page, and would like to have the latest $vboptions[bbtitle] news appear there, you can<br /><center><a href="http://add.my.yahoo.com/rss?url=$vboptions[bburl]/external.php?type=RSS2"><img src="$stylevar[imgdir_misc]/addtomyyahoo2.gif" width="100" height="14" border="0" alt="" /></a></center>
</td>
</tr>
</tbody>
</table>
<br />
</if>
</if>

Hope this helps!

Our Sponsors
 

Viks
02-09-2005, 02:32 AM
Awesome!!!

thanks 58sniper and teamrocket!!

But How can i get this to show for all users on my website!!? right now only members can see it.

gregwatson
02-20-2005, 04:22 AM
I use My Yahoo ... but I don't have a Yahoo Email address ...

Is there a reason why this module is limited to those who have a Yahoo Email address or a Yahoo IM?

Greg

Our Sponsors
 

mfarmerhi
05-28-2005, 06:07 PM
I use My Yahoo ... but I don't have a Yahoo Email address ...

Is there a reason why this module is limited to those who have a Yahoo Email address or a Yahoo IM?

GregJust take out the second "if" conditional, no...?