View Single Post
  #13  
Old 05-15-2007, 03:08 AM
bert Offline
forum loafer
 
Join Date: Dec 2006
Location: Rotterdam
Posts: 9
just added this to index.php. to switch css for image or video.
depending on custom field for video css stylesheet switches to video or image.
added display:none; to the div for the video player in the video.css..

added this to index php at line 650

$query = "SELECT a.name, b.value FROM ".$pixelpost_db_prefix."customfields AS a, ".$pixelpost_db_prefix."customfieldsvalues AS b WHERE b.customfield_id = a.id AND b.parent_id=$image_id AND a.enable='on' AND a.visible='on' order by a.fieldorder";
$result = mysql_query($query) or die("Invalid query (2): " . mysql_error());
while(list($cf_name, $cf_value) = mysql_fetch_row($result))
{
$videocss = '<link rel="stylesheet" type="text/css" href="templates/simple/styles/video.css" title="light" />';
$imagecss = '<link rel="stylesheet" type="text/css" href="templates/simple/styles/image.css" title="light" />';


$cf_value = pullout($cf_value);
if ($cf_value == ".flv"){ $tpl = str_replace("<STYLESHEET>",$imagecss,$tpl);
}
elseif ($cf_value == ".flv"){ $tpl = str_replace("<STYLESHEET>",$imagecss,$tpl);
}
else { $tpl = str_replace("<STYLESHEET>",$videocss,$tpl);
}
}


and it works!!! next week i will try to get some mess out of the code and make a better post. i go to sleep now.. 14 hours of pixelposting.........
Reply With Quote