- Readme First! - Read and follow the rules, otherwise your posts will be closed
There are currently, 65 guest(s) and 0 member(s) that are online. You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Change theme to use php for header [ ]
Author
Message
TwiztedIndian
Nuke Soldier
Joined: Aug 28, 2003
Posts: 16
Posted:
Wed Jun 02, 2004 2:49 pm
I am currently useing a theme I have heavily modified and I am wanting to setup so I can use header.php instead of header.html.... I tried changing the template call in the theme.php to header.php but it does not work. Is this possible?
Evaders99
Site Admin
Joined: Aug 17, 2003
Posts: 12397
Posted:
Wed Jun 02, 2004 5:23 pm
TwiztedIndian
Nuke Soldier
Joined: Aug 28, 2003
Posts: 16
Posted:
Wed Jun 02, 2004 5:37 pm
I done that cleared out the header.html file and just had include('header.php'); in it and it just passes the text... does not pass it as PHP...
Basically the header.php file I want to use is one I made that has a little bit of PHP code before it echo's out the original header.html content with some variables within it.... it does not take the place of all the header function in the Theme.php file...
I am building the header for a non-profit Radio station site I am building with a friend and we want the current station info on the header... I have all that working fine here http://twizted.kicks-Rainbow Brite.net/themes/Digital_Radiance/header.php
which is for the site theme here http://twizted.kicks-Rainbow Brite.net/
The header code is :
Code:
<?php
error_reporting (E_ALL ^ E_NOTICE);
require "scxml-obj.php";
require "config.php";
$serv1 = new SCXML;
$serv1->set_host("$host");
$serv1->set_port("$port");
$serv1->set_password("$password");
$serv1->set_url("$url");
if (!$serv1->retrieveXML()) DIE ("$error1");
$con_dsp=$serv1->fetchMatchingTag("STREAMSTATUS");
if (!$con_dsp == "1") DIE ("$error2");
$cur_listen=$serv1->fetchMatchingTag("CURRENTLISTENERS");
if ($cur_listen == "") {
$cur_listen = 0;
}
$peak_listen=$serv1->fetchMatchingTag("PEAKLISTENERS");
$max_listen=$serv1->fetchMatchingTag("MAXLISTENERS");
$title=$serv1->fetchMatchingTag("SERVERTITLE");
$song_title=$serv1->fetchMatchingTag("SONGTITLE");
$server_genre=$serv1->fetchMatchingTag("SERVERGENRE");
$aim=$serv1->fetchMatchingTag("AIM");
$irc=$serv1->fetchMatchingTag("IRC");
$con_hostname=$serv1->fetchMatchingArray("HOSTNAME");
$con_listen=$serv1->fetchMatchingArray("CONNECTTIME");
$con_song=$serv1->fetchMatchingArray("TITLE");
$con_song_print=array_slice($con_song, 1, $maxsongs);
$con_time=$serv1->fetchMatchingArray("PLAYEDAT");
if (preg_match ("/^[0-9]{10}$/", $con_time[0])) {
for ($i=0; $i<count($con_time); $i++) {
$con_time[$i] = date('H:i:s', $con_time[$i]);
}
$playtime = $con_time;
}
else {
$playtime = $con_time;
}
if ($timeat == "0") {
$playat = array_shift ($playtime);
} else {
$playtime = $playtime;
}
echo " <meta http-equiv=\"Content-Language\" content=\"en-us\">\n";
echo " <SCRIPT LANGUAGE=\"JavaScript\" src=\"themes/Digital_Radiance/js/links.js\"></script>\n";
echo " <SCRIPT LANGUAGE=\"JavaScript1.2\">\n";
echo " function makevisible(cur,which){\n";
echo " if (which==0) cur.filters.alpha.opacity=100\n";
echo " else cur.filters.alpha.opacity=0 }\n";
echo " </SCRIPT>\n";
echo " <BODY BGCOLOR=#FFFFFF leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">\n";
echo " <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#000000\" width=\"100%\" height=\"150\">\n";
echo " <tr>\n";
echo " <td width=\"100%\" height=\"120\" colspan=\"5\">\n";
echo " <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"100%\" id=\"AutoNumber1\" height=\"120\">\n";
echo " <tr>\n";
echo " <td width=\"400\" height=\"120\" background=\"/themes/Digital_Radiance/images/header_left.jpg\"><a href=\"index.php\"><img src=\"/themes/Digital_Radiance/images/header_left.jpg\" border=\"0\"></a></td>\n";
echo " <td background=\"/themes/Digital_Radiance/images/header_tile.jpg\"><br><center><font size=\"4\" color=\"white\" face\"$font\">Server Info</font><br><font size=\"2\" face=\"$font\" color=\"white\">DJ:$server_genre<br>$title<br>$song_title</font></center></td>\n";
echo " <td width=\"150\" background=\"/themes/Digital_Radiance/images/header_right.jpg\"><br><a href=\"http://$url:$port/listen.pls\"><font color=\"white\" face=\"$font\" size=\"2\"><img src=\"images/winamp.gif\" border=\"0\" align=\"absmiddle\">(Dialup)</font></a><br><a href=\"http://$url:$port/listen.pls\"><font color=\"white\" face=\"$font\" size=\"2\"><img src=\"images/winamp.gif\" border=\"0\" align=\"absmiddle\">(Broadband)</font></a></td>\n";
echo " </tr>\n";
echo " </table>\n";
echo " </td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td width=\"21\" height=\"80\" background=\"/themes/Digital_Radiance/images/Nav_left.jpg\">\n";
echo " </td>\n";
echo " <td width=\"454\" height=\"80\" background=\"/themes/Digital_Radiance/images/Nav_left.jpg\">\n";
echo " <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"440\" id=\"AutoNumber2\" height=\"80\">\n";
echo " <tr>\n";
echo " <td width=\"88\" height=\"80\" background=\"/themes/Digital_Radiance/images/Nav_button1_off.gif\"><a href=\"/modules.php?name=Feedback\"><img border=\"0\" src=\"/themes/Digital_Radiance/images/Nav_button1_on.gif\" width=\"88\" height=\"80\" style=\"filter:alpha(opacity=0)\" onMouseover=\"makevisible(this,0)\" onMouseout=\"makevisible(this,1)\"></a></td>\n";
echo " <td width=\"88\" height=\"80\" background=\"/themes/Digital_Radiance/images/Nav_button2_off.gif\"><a href=\"/modules.php?name=Feedback\"><img border=\"0\" src=\"/themes/Digital_Radiance/images/Nav_button2_on.gif\" width=\"88\" height=\"80\" style=\"filter:alpha(opacity=0)\" onMouseover=\"makevisible(this,0)\" onMouseout=\"makevisible(this,1)\"></a></td>\n";
echo " <td width=\"88\" height=\"80\" background=\"/themes/Digital_Radiance/images/Nav_button3_off.gif\"><a href=\"/modules.php?name=Feedback\"><img border=\"0\" src=\"/themes/Digital_Radiance/images/Nav_button3_on.gif\" width=\"88\" height=\"80\" style=\"filter:alpha(opacity=0)\" onMouseover=\"makevisible(this,0)\" onMouseout=\"makevisible(this,1)\"></a></td>\n";
echo " <td width=\"88\" height=\"80\" background=\"/themes/Digital_Radiance/images/Nav_button4_off.gif\"><a href=\"/modules.php?name=Feedback\"><img border=\"0\" src=\"/themes/Digital_Radiance/images/Nav_button4_on.gif\" width=\"88\" height=\"80\" style=\"filter:alpha(opacity=0)\" onMouseover=\"makevisible(this,0)\" onMouseout=\"makevisible(this,1)\"></a></td>\n";
echo " <td width=\"88\" height=\"80\" background=\"/themes/Digital_Radiance/images/Nav_button5_off.gif\"><a href=\"/modules.php?name=Web_Links\"><img border=\"0\" src=\"/themes/Digital_Radiance/images/Nav_button5_on.gif\" width=\"88\" height=\"80\" style=\"filter:alpha(opacity=0)\" onMouseover=\"makevisible(this,0)\" onMouseout=\"makevisible(this,1)\"></a></td>\n";
echo " </tr>\n";
echo " </table>\n";
echo " </td>\n";
echo " <td width=\"8\" height=\"80\" background=\"/themes/Digital_Radiance/images/Nav_left.jpg\">\n";
echo " </td>\n";
echo " <td background=\"/themes/Digital_Radiance/images/Nav_left.jpg\" width=\"471\">\n";
echo " <img src=\"images/banners/banner.gif\" width=\"468\" heigth=\"60\" height=\"60\" border=\"0\" align=\"right\"></td>\n";
echo " <td background=\"/themes/Digital_Radiance/images/Nav_left.jpg\" width=\"20\">\n";
echo " </td>\n";
echo " </tr>\n";
echo " <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"100%\">\n";
echo " <tr>\n";
echo " <td width=\"100%\"><font size=\"2\"> </font></td>\n";
echo " </tr>\n";
echo " </table>\n";
echo " <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\"><tr valign=\"top\">\n";
echo " <td></td></tr></table>\n";
echo " <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\"><tr valign=\"top\">\n";
echo " <td></td>\n";
echo " <td width=\"165\" valign=\"top\">\n";
echo " </BODY>\n";
echo " </HTML>";
As you can see it requires two other files... also... If I could figure out how to pass the first part of that code up to the point I start the echo's I think I could figure out how to manage with keeping it a header.html file... since you can pass var's through it anyway (such as $theuser)
Evaders99
Site Admin
Joined: Aug 17, 2003
Posts: 12397
Posted:
Wed Jun 02, 2004 5:46 pm
TwiztedIndian
Nuke Soldier
Joined: Aug 28, 2003
Posts: 16
Posted:
Wed Jun 02, 2004 5:54 pm
haha.... your not following me...
The $theuser was an example ....
What I am trying to do is parse a whole diff set of files for gathering the info I need from the XML output of Shoutcast server....
Basically I have this
Code:
error_reporting (E_ALL ^ E_NOTICE);
require "scxml-obj.php";
require "config.php";
$serv1 = new SCXML;
$serv1->set_host("$host");
$serv1->set_port("$port");
$serv1->set_password("$password");
$serv1->set_url("$url");
if (!$serv1->retrieveXML()) DIE ("$error1");
$con_dsp=$serv1->fetchMatchingTag("STREAMSTATUS");
if (!$con_dsp == "1") DIE ("$error2");
$cur_listen=$serv1->fetchMatchingTag("CURRENTLISTENERS");
if ($cur_listen == "") {
$cur_listen = 0;
}
$peak_listen=$serv1->fetchMatchingTag("PEAKLISTENERS");
$max_listen=$serv1->fetchMatchingTag("MAXLISTENERS");
$title=$serv1->fetchMatchingTag("SERVERTITLE");
$song_title=$serv1->fetchMatchingTag("SONGTITLE");
$server_genre=$serv1->fetchMatchingTag("SERVERGENRE");
$aim=$serv1->fetchMatchingTag("AIM");
$irc=$serv1->fetchMatchingTag("IRC");
$con_hostname=$serv1->fetchMatchingArray("HOSTNAME");
$con_listen=$serv1->fetchMatchingArray("CONNECTTIME");
$con_song=$serv1->fetchMatchingArray("TITLE");
$con_song_print=array_slice($con_song, 1, $maxsongs);
$con_time=$serv1->fetchMatchingArray("PLAYEDAT");
if (preg_match ("/^[0-9]{10}$/", $con_time[0])) {
for ($i=0; $i<count($con_time); $i++) {
$con_time[$i] = date('H:i:s', $con_time[$i]);
}
$playtime = $con_time;
}
else {
$playtime = $con_time;
}
if ($timeat == "0") {
$playat = array_shift ($playtime);
} else {
$playtime = $playtime;
}
that needs to be run then I can just pass the vars I need such as $song_title, $server_genre ect ect in the regular ol' html file.... lets forget I even have the header.php.... I want to the above code to parse so I can pass the new var's through my header.html...
When I put the above code into my theme.php file all I get is a white page... I am not sure how it should be inserted into the file which is why it is crashing the theme.. any suggestions?
Evaders99
Site Admin
Joined: Aug 17, 2003
Posts: 12397
Posted:
Wed Jun 02, 2004 9:41 pm
TwiztedIndian
Nuke Soldier
Joined: Aug 28, 2003
Posts: 16
Posted:
Thu Jun 03, 2004 7:04 am
I can send you the Station Info Display if you want. Unless you have a station you have access to I would have to leave it configured for mine.. lmk and I will e-mail them to you if you leave me an addy.... if you dont get back within around 20 minutes I will not be back till Friday evening so just let me know and I will send them by then....
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum