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, 52 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 - Code problem [ ]
 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
Goodgraves
Nuke Cadet
Nuke Cadet


Joined: Sep 25, 2006
Posts: 8


PostPosted: Sun Sep 24, 2006 6:26 pm Reply with quoteBack to top

Hello all.

Could someone help me with my code please?

After spending many of hours trying to fix my problem I turned to you for help.

I have a block that I can't get to render properly. The block shows up on my page just fine and looks good but I can't get the PHP block frams to wrap around it. The block frames appear right below my working code, but with with the following in the block, " There isn't content right now for this block." I have read all the guides on how to creat a block, but I am having trobles with the $contect code.

Could someone help me with my code please?

Code:
<center>
<font class="content">
<form method="get" action="http://www.thottbot.com/" target="_blank">
<a href="http://www.thottbot.com/" target="_blank">
<img src="images/thottbot.gif" alt="Thottbot" border="0" height="22" width="75"></a><br>
<input name="s" style="width: 140px;" onfocus="this.select()" type="text">
</form>
</font>
</center>
<br>
<center>
<font class="content">
<form method="get" action="http://wow.allakhazam.com/search.html" target="_blank">
<a href="http://wow.allakhazam.com/" target="_blank"><img src="images/allakhazam.gif" alt="Allakhazam" border="0" height="22" width="75"></a><br>
<input name="q" style="width: 140px;" onfocus="this.select()" type="text">
</form>
</font>
</center>
<br>
<center>
<font class="content">
<form method="get" action="http://www.wowhead.com/" target="_blank">
<a href="http://www.wowhead.com/" target="_blank"><img src="images/wowhead.gif" alt="Wowhead" border="0" height="22" width="75"></a><br>
<input name="search" style="width: 140px;" onfocus="this.select()" type="text">
</form>
</font>
</center>


Any help would be greatly apprecated. Thank you inadvance for any help you might have.
Find all posts by GoodgravesView user's profileSend private message
spottedhog
Captain
Captain


Joined: Apr 30, 2004
Posts: 566


PostPosted: Sun Sep 24, 2006 6:50 pm Reply with quoteBack to top

OK... I will make a statement here.... You are using a lot of deprecated html code. I removed that code and replaced it with the proper coding. By deprecated I mean that <center> and <font> is no longer used. Also the <img>, <input> and <br> need to be closed by using />.

You will need to change the BLOCKNAMEHERE to the actual name you wish to use.


Try this:

Code:
<?php

/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/

if (eregi("block-BLOCKNAMEHERE.php",$_SERVER['PHP_SELF'])) {
    Header("Location: index.php");
    die();
}

$content = "";

$content .="<div align=\"center\">";
$content .="<form method=\"get\" action=\"http://www.thottbot.com/\" target=\"_blank\">";
$content .="<a href=\"http://www.thottbot.com/\" target=\"_blank\">";
$content .="<img src=\"images/thottbot.gif\" alt=\"Thottbot\" border=\"0\" height=\"22\" width=\"75\" alt=\"\" /></a><br />";
$content .="<input name=\"s\" style=\"width: 140px;\" onfocus=\"this.select()\" type=\"text\" />";
$content .="</form>";
$content .="<br />";
$content .="<form method=\"get\" action=\"http://wow.allakhazam.com/search.html\" target=\"_blank\">";
$content .="<a href=\"http://wow.allakhazam.com/\" target=\"_blank\"><img src=\"images/allakhazam.gif\" alt=\"Allakhazam\" border=\"0\" height=\"22\" width=\"75\" /></a><br />";
$content .="<input name=\"q\" style=\"width: 140px;\" onfocus=\"this.select()\" type=\"text\" />";
$content .="</form>";
$content .="<br />";
$content .="<form method=\"get\" action=\"http://www.wowhead.com/\" target=\"_blank\">";
$content .="<a href=\"http://www.wowhead.com/\" target=\"_blank\"><img src=\"images/wowhead.gif\" alt=\"Wowhead\" border=\"0\" height=\"22\" width=\"75\" alt=\"\" /></a><br />";
$content .="<input name=\"search\" style=\"width: 140px;\" onfocus=\"this.select()\" type=\"text\" />";
$content .="</form>";
$content .="</div>";

?>

_________________
SMF-Nuke admin

SMF and PHP Nuke integration is ready! Take a look at it by clicking on the link above.
Find all posts by spottedhogView user's profileSend private messageSend e-mailVisit poster's website
Goodgraves
Nuke Cadet
Nuke Cadet


Joined: Sep 25, 2006
Posts: 8


PostPosted: Sun Sep 24, 2006 7:12 pm Reply with quoteBack to top

WOW,

Thank you very much. I will work on my coding. Would you recommend any sites where I could learn more about they way you just coded that.

Thank you again, it looks great. I didn't even think of that. Your a great coder thank you for your advince.
Find all posts by GoodgravesView user's profileSend private message
spottedhog
Captain
Captain


Joined: Apr 30, 2004
Posts: 566


PostPosted: Mon Sep 25, 2006 9:26 am Reply with quoteBack to top

Here is a quickie lesson for $content and echo.....

Both $content (blocks output code) and echo (module output code) have the same coding properties.

$content = " some code here ";

echo " some code here ";

Please notice the double quotes. These mark the beginning of something to be shown, and the end of showing something. The semi-colon stops things.

Your main problem was that you were not commenting out the double quotes where the --showing code-- would be. For example:

Code:
$content .="<div align=\"center\">";


Please note the backslashes in front of the double quotes. The backslashes allows php to display code past the double quote. Otherwise, php would only display:

Code:
<div align=

This would be a bad error because there was not a semi-colon after the last double quote. This is why the code would jump out of the block so to speak.

As far as the to the compliant html......
http://www.w3schools.com/tags

_________________
SMF-Nuke admin

SMF and PHP Nuke integration is ready! Take a look at it by clicking on the link above.
Find all posts by spottedhogView user's profileSend private messageSend e-mailVisit poster's website
Goodgraves
Nuke Cadet
Nuke Cadet


Joined: Sep 25, 2006
Posts: 8


PostPosted: Mon Sep 25, 2006 2:11 pm Reply with quoteBack to top

Noted, thank you for your help. I apprecate your help. I am tring to learn PHP and your help is greatly apprecated.

Thank you very much.
Find all posts by GoodgravesView 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.522 Seconds - 391 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::