SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Php Newbie help

  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2001
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,
    I'm using PhpNuke as my web page and would like to integrate a background image for every page. I'm very new to php and don't know how to add it. I assume I would add it to the themes.php page as that determine the looks of the page. I have included the code for themes.php. If someone can look at this and tell me if this would be the page to add the background path, I would appreciate it.

    Code:
    <?php
    
    $thename = "AnalogX";
    $lnkcolor = "3E6EB6";
    $bgcolor1 = "#B3C0D7";
    $bgcolor2 = "#6E7684";
    $bgcolor3 = "#6E7684";
    $textcolor1 = "#FFFFFF";
    $textcolor2 = "#000000";
    $hr = 1; # 1 to have horizonal rule in comments instead of table bgcolor
    
    function themepreview($title, $hometext, $bodytext="", $notes="") {
    	echo "<p><b>$title</b><br>$hometext<br><br>$bodytext $notes";
    }
    
    function themeindex ($aid, $informant, $time, $title, $counter, $topic, $thetext, $notes, $morelink, $topicname, $topicimage, $topictext) {
    	global $tipath, $anonymous;
    	if ("$aid" == "$informant") { ?>
    <table border=1 cellpadding=0 cellspacing=0 width=100% bordercolor=6E7684>
    <tr><td width=100%>
    <font color=6E7684><b><i>&nbsp;<?php echo"$title"; ?></i></b></font>
    <font color=6E7684 size=-2>&nbsp;[<?php formatAidHeader($aid) ?>]</td></tr>
    <tr><td align=right width=100% bgcolor=6E7684>
    <font color=FFFFFF size=-2><?php echo"$time $timezone"; ?>&nbsp; </font>
    </td></tr></table><table border=0 cellpadding=0 cellspacing=0 width=100%><tr><td>
    <p><a href="search.php?query=&topic=<?php echo"$topic"; ?>&author=">
    <img src=<?php echo"$tipath$topicimage"; ?> border=0 Alt=<?php echo"\"$topictext\""; ?> align=left hspace=10 vspace=10></a>
    &nbsp;&nbsp;&nbsp;&nbsp;<?php echo"$thetext
    </td></tr><tr><td align=right>
    <font size=-2>$morelink"; ?>
    </td></tr></table><br>
    
    <?php	} else {
    		if($informant != "") $boxstuff = "<a href=\"user.php?op=userinfo&uname=$informant\">$informant</a> ";
    		else $boxstuff = "$anonymous ";
    		$boxstuff .= "".translate("writes")." <i>\"$thetext\"</i> $notes";
    ?>
    
    <table border=1 cellpadding=0 cellspacing=0 width=100% bordercolor=6E7684>
    <tr><td width=100%>
    <font color=6E7684><b><i>&nbsp;<?php echo"$title"; ?></i></b></font>
    <font color=6E7684 size=-2>&nbsp;[<?php formatAidHeader($aid) ?>]</td></tr>
    <tr><td align=right width=100% bgcolor=6E7684>
    <font color=FFFFFF size=-2><?php echo"$time $timezone"; ?>&nbsp; </font>
    </td></tr></table><table border=0 cellpadding=0 cellspacing=0 width=100%><tr><td>
    <p><a href="search.php?query=&topic=<?php echo"$topic"; ?>&author=">
    <img src=<?php echo"$tipath$topicimage"; ?> border=0 Alt=<?php echo"\"$topictext\""; ?> align=left hspace=10 vspace=10></a>
    &nbsp;&nbsp;&nbsp;&nbsp;<?php echo"$boxstuff
    </td></tr><tr><td align=right>
    <font size=-2>$morelink"; ?>
    </td></tr></table><br>
    
    <?php	}
    }
    
    function themearticle ($aid, $informant, $datetime, $title, $thetext, $topic, $topicname, $topicimage, $topictext) {
    	global $admin, $sid, $tipath;
    	if ("$aid" == "$informant") {
    
    echo"
    <table border=1 cellpadding=0 cellspacing=0 width=100% bordercolor=6E7684>
    <tr><td width=100%>
    <font color=6E7684><b><i>&nbsp;$title</i></b></font>
    <font color=6E7684 size=-2>&nbsp;";
    
    if ($admin) {
        echo "&nbsp;&nbsp; [ <a href=admin.php?op=EditStory&sid=$sid>".translate("Edit")."</a> | <a href=admin.php?op=RemoveStory&sid=$sid>".translate("Delete")."</a> ]";
    }
    
    echo"
    </td></tr>
    <tr><td align=right width=100% bgcolor=6E7684>
    <font color=FFFFFF size=-2>".translate("Posted on ")." $datetime &nbsp; </font>
    </td></tr></table><table border=0 cellpadding=0 cellspacing=0 width=100%><tr><td>
    <p><a href=search.php?query=&topic=$topic&author=>
    <img src=$tipath$topicimage border=0 Alt=\"$topictext\" align=left hspace=10 vspace=10></a>
    &nbsp;&nbsp;&nbsp;&nbsp;$thetext
    </td></tr></table><br>";
    
    	} else {
    		if($informant != "") $informant = "<a href=\"user.php?op=userinfo&uname=$informant\">$informant</a> ";
    		else $boxstuff = "$anonymous ";
    		$boxstuff .= "".translate("writes")." <i>\"$thetext\"</i> $notes";
    echo "
    
    <table border=1 cellpadding=0 cellspacing=0 width=100% bordercolor=6E7684>
    <tr><td width=100%>
    <font color=6E7684><b><i>&nbsp;$title</i></b> - ".translate("Contributed by ")." $informant </font>
    <font color=6E7684 size=-2>&nbsp;";
    if ($admin) {
        echo "&nbsp;&nbsp; [ <a href=admin.php?op=EditStory&sid=$sid>".translate("Edit")."</a> | <a href=admin.php?op=RemoveStory&sid=$sid>".translate("Delete")."</a> ]";
    }
    echo"
    </td></tr>
    <tr><td align=right width=100% bgcolor=6E7684>
    <font color=FFFFFF size=-2>".translate("Posted on ")." $datetime &nbsp; </font>
    </td></tr></table><table border=0 cellpadding=0 cellspacing=0 width=100%><tr><td>
    <p><a href=search.php?query=&topic=$topic&author=>
    <img src=$tipath$topicimage border=0 Alt=\"$topictext\" align=left hspace=10 vspace=10></a>
    &nbsp;&nbsp;&nbsp;&nbsp;$thetext
    </td></tr></table><br>";
    	}
    }
    
    function themesidebox($title, $content) {
        echo "
        <tr><td background=themes/AnalogX/menutitle.gif height=28 width=150 valign=top>
        <font size=-2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp</font>
        <b><font size=-2>$title</font></b>
        </td></tr><tr><td bgcolor=B3C0D7 width=17%>
        </td></tr><tr><td bgcolor=B3C0D7 width=83% valign=top> 
        <font size=-2>$content</font><br>
        </td></tr><tr><td>&nbsp;</td></tr>";
    }
    
    function searchbox() {
        global $uimages, $sitename;
        echo "
        <tr><td background=themes/AnalogX/menutitle.gif height=28 width=150 valign=top>
        <font size=-2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp</font>
        <b><font size=-2>".translate("Search")."</font></b>
        </td></tr><tr><td bgcolor=B3C0D7 width=17%>
        </td></tr><tr><td bgcolor=B3C0D7 width=83% valign=top>
        <font size=-2><center>
        <br>$sitename
        <form action=search.php method=post>
        <input type=text name=query size=12>
        <br><input type=image src=$uimages/search.gif border=0>
        </form>
        </center></font><br>
        </td></tr><tr><td>&nbsp;</td></tr>";
    }
    
    ?>
    Thanks guys

  2. #2
    Not Bad, eh? Justin Sampson's Avatar
    Join Date
    Aug 2000
    Location
    N.S., Canada
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't think thats the right file to add it to because there is no <body> tag.

    You should be able to add it just like html because php is a server side programing language.

    Hope it helps

    Justin Sampson

    <Edited by justin_sampson on 02-03-2001 at 12:50 PM>

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2001
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,
    Thanks for your help Justin. I have the BackGround working but have a question. The backGround is 800x600 and it appears to be using the image more then once to cover the length of the page. My width is fine, but I have the page set up to add news and to extend the length with each post. You can see what I mean here www.mega-strike.net/nuke/html/index.php How would you suggest to over come this problem. I guess I want the image to stay at the top of the page.
    Thanks

  4. #4
    SitePoint Enthusiast
    Join Date
    Jan 2001
    Location
    Helsingborg, Sweden
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure, but I believe the only way to solve this without doing anything fancy stuff like Dynamic HTML is to make the image itself bigger. Try padding the image with white and make it larger. If it's 800x600 now, you could try to make an image that is perhaps 1300x2000 or something like that. The problem is if it's a jpeg. Then the image will be huge. If it's a gif, it won't matter.
    "Some people play hard to get - I play hard to want."

  5. #5
    SitePoint Enthusiast
    Join Date
    Jan 2001
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What would I use to have the image slide down as I scrol down the page. I have seen it before on other webs. Maybe I should just have another back image made, one for the top and one for the bottom. Then make a long image for the side.
    Thanks for you help anyways guys


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •