PDA

View Full Version : How Do I.. make a different phrase appear for the web site name field and description


turbosatan
12-02-2008, 09:16 AM
i need to change the "website_name" variable based on the category which has been picked in the previous page

Also i would then need to change the display name on the page where the links are displayed for those particular categories

Thanks in advance

Brian
12-03-2008, 11:01 AM
You would just need to add two new plugins to the 'vba_links_addlink_complete' and 'vba_links_showlink_showdetails_start' hook locations, both with code that looks something like this:

if ($link['catid'] == X)
{
$vbphrase['website_name'] = 'Your Phrase Goes Here';
}

Our Sponsors
 

turbosatan
12-04-2008, 05:30 AM
could i extend that to have an else clause as there are just three categories which i really need to change it for?

also would i be able to supply an array to the first if statement for ther category ID's?


if ($link['catid'] == 10,11,12)
{
$vbphrase['website_name'] = 'Your Phrase Goes Here';
}
else
{
$vbphrase['website_name'] = 'regular phrase goes here';
}

Brian
12-05-2008, 10:23 AM
Yes. Just change the first line to an array. There's no need for an "else" statement though since the phrase will already be set to the default value.

if (in_array($link['catid'], array(10, 11, 12)))