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.
Any help would be greatly apprecated. Thank you inadvance for any help you might have.
spottedhog Captain
Joined: Apr 30, 2004
Posts: 566
Posted:
Sun Sep 24, 2006 6:50 pm
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();
}
SMF and PHP Nuke integration is ready! Take a look at it by clicking on the link above.
Goodgraves Nuke Cadet
Joined: Sep 25, 2006
Posts: 8
Posted:
Sun Sep 24, 2006 7:12 pm
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.
spottedhog Captain
Joined: Apr 30, 2004
Posts: 566
Posted:
Mon Sep 25, 2006 9:26 am
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.
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