PDA

View Full Version : allow admin to put google ads in signature


Triality
02-16-2005, 03:54 AM
i am requesting a hack that would allow me to use javascript in only the admin signature so that i can place google ads in my sig. maybe its already available, but i cant seem to find it!

thanks
Jordan Blackburn

SVTBlackLight01
02-16-2005, 11:14 PM
You could do this in the postbit/postbit_legacy by adding this
<if condition="is_member_of($post, 6)">
your Google ad (or any HTML) code here
</if> under
$post[signature]

I'm using it to list a few of my site features, including vBRadio pop-up Javascript.

http://www.modernengineuity.com/forums/showpost.php?p=9663&postcount=13

Triality
02-17-2005, 03:21 AM
works perfect man thanks a lot!

SVTBlackLight01
02-17-2005, 10:20 PM
You're welcome! :)

Phillip Chapman
03-13-2005, 01:45 AM
I'm having difficulty getting this working. Currently I have the following in the signature section in both the postbit and postbit/legacy templates.

<!-- sig -->
<div>
__________________<br />
$post[signature]
</div>
<if condition="is_member_of($post, 6)">
HTML IS HERE</if>
<!-- / sig -->

Only vCode is on for all members and they have a signature limit of 125 characters. The code I'd like to run in my sig (admin) is...

<?php
$username = "muppetcentral";

if(isset($_GET["afl"])) {
$afl = 1;
$url = "http://www.live365.com/pls/front?handler=playlist&cmd=view&handle=afl%3A" . $username;
} else {
$std = 1;
$url = "http://www.live365.com/pls/front?handler=playlist&cmd=view&handle=" . $username;
}

$fp = fopen($url, "r");
while($line = fgets($fp, 255)) {
if(ereg( "artist:\"([^\"]*)\"", $line, $regs)) {
$artist[] = $regs[1];
} else if(ereg( "title:\"([^\"]*)\"", $line, $regs)) {
$title[] = $regs[1];
} else if(ereg( "album:\"([^\"]*)\"", $line, $regs)) {
$album[] = $regs[1];
}
}
fclose($fp);

for($i=0; $i<=2; $i++) {
if($artist[$i] != "") {
$_artist = $artist[$i];
$_title = $title[$i];
$_album = $album[$i];
break;
}
}

$_album_disp = ereg_replace(":", "-", $_album);
$_album_disp = ereg_replace("/", "-", $_album_disp);
$_album_disp = ereg_replace("?", "-", $_album_disp);
$_artist_disp = ereg_replace(":", "-", $_artist);
$_artist_disp = ereg_replace("/", "-", $_artist_disp);

?>
<a href="http://www.muppetcentral.com/radio/"><strong>Now Playing:</strong></a>
<?= $_title ?>
-
<?= $_artist ?>

I appreciate any help that you can provide.