The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
Hi all i have some code i want to insert into my forum ie this
Code:
function convert_aff_links( $_body, $_aff_id = '2pz' )
{
$_body = preg_replace
(
'@://(w+\.)?(playasia|play-asia)\.com/?([^/a-zA-Z])@',
'://www.play-asia.com/SOap-23-' . '83-' . $_aff_id . '-50-00.html$3',
$_body
);
$_body = preg_replace
(
'/paOS-(\d{2})/',
'SOap-23-' . '83-' . $_aff_id . '-50-$1',
$_body
);
return $_body;
}
|
|
#2
|
||||
|
||||
|
You cannot put php code in a template. Templates are for html. If you need to add php code, you need to either edit the file or add it in a plugin.
|
|
#3
|
|||
|
|||
|
thanks for the reply, where would be a good place to insert the code to test it ?
|
|
#4
|
||||
|
||||
|
You want this run on every page? I suppose you could try one of the global_xx locations.
|
|
#5
|
|||
|
|||
|
thanks again, yes every page would be great, ill give the global locations a try
![]() --------------- Added [DATE]1234116527[/DATE] at [TIME]1234116527[/TIME] --------------- hmm not working, im begining to wonder if the code is actually valid thanks for the replys, ill have to admit defeat i reckon
|
|
#6
|
||||
|
||||
|
You are probably looking to modify the $output variable in global_complete.
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|