It is not picking up.. Any idea why? I want nested tables but i am unable to do so. Please guide.
Can a block have more than one table? If so how do i do that?
Any help appreciated! Thanks a ton!!!!
arnoldkrg Major
Joined: Aug 03, 2003
Posts: 936
Location: United Kingdom
Posted:
Fri Feb 16, 2007 5:53 am
You need to write your own block. Heres an example using nested tables:
Code:
<?php
if (eregi("block-Tables.php",$_SERVER['PHP_SELF'])) {
Header("Location: index.php");
}
$content = "";
$stuff = <<< End_Stuff
<table>
<tr>
<td align="center">This is some text in a table cell</td>
</tr>
<tr>
<td>First cell</td><td> Second cell/td>
</tr>
<tr>
<td colspan="2"><table>
<tr>
<td>First cell</td><td> Second cell</td>
</tr>
</table></td>
</tr>
</table>
End_Stuff;
$content .= $stuff;
?>
Save the above as block-Tables.php and upload to the blocks directory of your site. WARNING!!!! The copy/paste process may add invisible blank characters to the ends of codelines. These MUST be removed before uploading the file. I use Crimson Editor to find and remove these blank characters.
Next go to admin.php....blocks and create your Block by scrolling down and giving it a title. Next select Tables from the dropdown Filename select box and click create.
Explanation
See how I have slotted straight forward html between:
Code:
$stuff = <<< End_Stuff
and:
Code:
End_Stuff;
This is a heredoc and can be used to add straightforward HTML or Javascript to any block.
You can create similar blocks using the same method. Change:
Code:
if (eregi("block-Tables.php",$_SERVER['PHP_SELF'])) {
Header("Location: index.php");
}
to:
Code:
if (eregi("block-Anotherblock.php",$_SERVER['PHP_SELF'])) {
Header("Location: index.php");
}
and you can save as block-Anotherblock.php, and now you have a second block
_________________
aashish Nuke Cadet
Joined: Feb 16, 2007
Posts: 2
Posted:
Sat Feb 17, 2007 5:04 am
That worked well!
Really appreciate your skill set!
Also if I have to turn off a left navigation and right navigation for a particular module say "downloads".. how is it done?
Thanks again!!!
arnoldkrg Major
Joined: Aug 03, 2003
Posts: 936
Location: United Kingdom
Posted:
Sat Feb 17, 2007 7:43 am
In modules/Downloads/index.php find:
Code:
define('INDEX_FILE', true);
and comment out that line thus:
Code:
//define('INDEX_FILE', true);
That will get rid of the right blocks for the Downloads module.
In themes/yourtheme/theme.php find the themeheader function:
In that function find the globals line. Something like:
Code:
global $banners, $sitename;
and add into that line $name thus:
Code:
global $banners, $sitename, $name;
Next in same function find:
Code:
blocks("left");
and change to:
Code:
if($name != "Downloads")
{
blocks("left");
}
That will disable left blocks too for the Downloads module. If you want to get rid of left blocks for other modules, just add them as below:
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