You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
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 [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
TwiztedIndian
Nuke Soldier
Nuke Soldier


Joined: Aug 28, 2003
Posts: 16


PostPosted: Wed Jun 02, 2004 2:49 pm Reply with quoteBack to top

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?
Find all posts by TwiztedIndianView user's profileSend private message
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12397


PostPosted: Wed Jun 02, 2004 5:23 pm Reply with quoteBack to top

Let's assume your header.php file does all the needed parsing that the the theme.php did, then all you need to do is this (replacing all the header.html code):

include('header.php');

_________________
Helping those that help themselves
Read FIRST or DIE!

"Fighting is terrible, but not as terrible as losing the will to fight."
Star Wars Rebellion Network - Need Help? Evaders Squadron Coding
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
TwiztedIndian
Nuke Soldier
Nuke Soldier


Joined: Aug 28, 2003
Posts: 16


PostPosted: Wed Jun 02, 2004 5:37 pm Reply with quoteBack to top

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 "          &nbsp;</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 "          &nbsp;</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\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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)
Find all posts by TwiztedIndianView user's profileSend private message
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12397


PostPosted: Wed Jun 02, 2004 5:46 pm Reply with quoteBack to top

Easy.. make sure $theuser is defined in your theme.php before you do your include. Your header.php should be able to use that variable directly.

_________________
Helping those that help themselves
Read FIRST or DIE!

"Fighting is terrible, but not as terrible as losing the will to fight."
Star Wars Rebellion Network - Need Help? Evaders Squadron Coding
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
TwiztedIndian
Nuke Soldier
Nuke Soldier


Joined: Aug 28, 2003
Posts: 16


PostPosted: Wed Jun 02, 2004 5:54 pm Reply with quoteBack to top

haha.... your not following me...
The $theuser was an example Wink....

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?
Find all posts by TwiztedIndianView user's profileSend private message
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12397


PostPosted: Wed Jun 02, 2004 9:41 pm Reply with quoteBack to top

Hmm.. it is killing your theme script eh? I'm not sure... maybe the require of the config.php....

I'll try adding to a theme and see what my code does.

_________________
Helping those that help themselves
Read FIRST or DIE!

"Fighting is terrible, but not as terrible as losing the will to fight."
Star Wars Rebellion Network - Need Help? Evaders Squadron Coding
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
TwiztedIndian
Nuke Soldier
Nuke Soldier


Joined: Aug 28, 2003
Posts: 16


PostPosted: Thu Jun 03, 2004 7:04 am Reply with quoteBack to top

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....
Find all posts by TwiztedIndianView user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
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



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.464 Seconds - 334 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::