ok well jsut about evrybody i know is haveing this problem or will have it .. all the other threads are very confusing with evrybody asking questions and stuff (not that thats a bad thing thats what they're their for.. thats how i fix my problems} but i jsut descided it would be a good idea to have a thread where evryone posts jsut possible fixes for it .. .. so.. what im asking is for people to use the other threads on this topic to ask questions and ppeople who get their problem fixed please post/describe your fix ...
hopefully in the end we will have created a 'guide' for this problem .. and save much forum space and time
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- frw responded to »Bug in the SMTP mail transfer protocol - Port 25 - Zikula 1.2.9« 22. May
- mdee responded to »Short URL questions« 22. May
- mesteele101 responded to »Problem in Database Connection« 21. May
- Herr.Vorragend responded to »Clip Documentation and Doubt« 19. May
- mazdev responded to »zikula 1.3.3. and IE9« 19. May
- mesteele101 responded to »How to install Zikula for MSSQL ??? - Part II« 19. May
- mesteele101 created topic »File packaging« 16. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
news/admin messages fix thread
-
**unknown user**
- Rank: Softmore
- Registered: Mar 16, 2002
- Last visit: Jun 26, 2009
- Posts: 109
ok well .. heres how i fixed mine .... ive found that it doesntr work on all themes, but seems to work on alot
1) find
Code
function themeheader() {
now go to the very end of the function ... the end is the very last ' } ' before the function
' themefooter '
and add this if it isnt already there
Code
so that area should now look like this
Code
2)find ' function themesidebox ' and add to the end of it (if its not already in there)
Code
its most likley that this is the end of the document if so it shoudl look like
Code
if for some reason its not the end of the file jsut leave out theCode
}
?>
3) ok well it should work now .. but you may find that the size of the section is messed up .. its the same size as teh menu bars.. rite?
now heres how I fixed that
i go back up to the themeheader function and the last thing before what i added (it may or may not bee the last thing because all
themes are different) wich is
Code
echo "<img src=\"images/pix.gif\" border=\"0\" width=\"150\" height=\"1\"></td><td> </td><td width=\"150\" valign=\"top\" align=\"right\">";
it may not look at all like that .. all themes are different .. what matters is that we find the 'echo' that has the info we need ... now it may not bee exactly where it is on mine on yours so .. the way to tell is to find something SIMMILAR to this .. and edit the width value .. (on mine i edit the second width value in that codetry changing that width to 100%Code
</td><td> </td><td width=\"150\" valign=\"top\" align=\"right\">";
...
try mine first then try fiddeling with other width values in that area till you find the right one to be editing)
now you'll notice that it now pushes the right blocks out of the way .... if so
youre going to have to change that width value down .. for mine i use 65%
example:
Code
echo "<img src=\"images/pix.gif\" border=\"0\" width=\"150\" height=\"1\"></td><td> </td><td width=\"65%\" valign=\"top\" align=\"right\">";
now that it looks right .. (note youll probably have to fiddle with all thes values to get it rite for you)
ok well now try going to another page .. jsut use liek members list or something liek that as an example .. now if thats all messed up and pushed to the side go to step 4
4) now since we have that problem what were going to have to do is tell it to only use thoes values we've gave it for the front page
how you go about doing this is
go back up to the 'themeheader' function and find that ligne with the ' width ' value you changed
for me itsCode
echo "<img src=\"images/pix.gif\" border=\"0\" width=\"150\" height=\"1\"></td><td> </td><td width=\"65%\" valign=\"top\" align=\"right\">";
now plase this infront of the echo (to keep it from getting all jumbled its better to plase this on a ligne abouve.you will have to close the 'if' statment too .. so after your 'echo' ligne add a blank ligne with jsut a } on it .. that should close thatCode
if ($GLOBALS['index']) {
what we jstu said is if were on the index page then ... continue on to the echo... blah blah blah
so it should now look somehting like this (keeping in mind mine will differ from yours unless you are also using the 0rion theme
Code
if ($GLOBALS['index']) {
echo "<img src=\"images/pix.gif\" border=\"0\" width=\"150\" height=\"1\"></td><td> </td><td width=\"65%\" valign=\"top\" align=\"right\">";
}
wel now it knows to do that on the index page .. we need to tell it what to do on other pages .. for his we will use an ' else ' statment
on the next ligne addCode
else {
now copy the exact "echo" ligne ffrom abov e but change that width value (in my example its been 65%) change it to 100% and close the else statment with a }
so that area should look similar to thisCode
if ($GLOBALS['index']) {
echo "<img src=\"images/pix.gif\" border=\"0\" width=\"150\" height=\"1\"></td><td> </td><td width=\"65%\" valign=\"top\" align=\"right\">";
}
else {
echo "<img src=\"images/pix.gif\" border=\"0\" width=\"150\" height=\"1\"></td><td> </td><td width=\"100%\" valign=\"top\" align=\"right\">";
}
except with ur info and stuff where mine are .. alwase keep in mind that these are sjtu examples yours will most ikley not look exactly liek that
the whole end of the themeheader function should now look liek this
Code
if ($GLOBALS['index']) {
echo "<img src=\"images/pix.gif\" border=\"0\" width=\"150\" height=\"1\"></td><td> </td><td width=\"65%\" valign=\"top\" align=\"right\">";
}
else {
echo "<img src=\"images/pix.gif\" border=\"0\" width=\"150\" height=\"1\"></td><td> </td><td width=\"100%\" valign=\"top\" align=\"right\">";
}
// If we have admin messages or blocks of 'centre' type, lets display them
if ($GLOBALS['index']) {
OpenTable();
echo '<div class="message-centre">';
blocks('centre');
echo '</div>';
CloseTable();
}
}
what we have jstu said is if index use these values(so as nto to mess up our right blocks) if not use different valuse .. if you have right blocks on other pages then 'index'
then you will have to add tha to the list inCode
if ($GLOBALS['index']) {
Now that im done .. if anyone else did it liek this and sees a fault or something ive left out in my explanation of my way of doing it .. please message me
dont reply because then people will get confused .. i will edit my post
admin@kg-archives.com -
**unknown user**
- Rank: Helper
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 676
That's a very confused way of explaining it, you seem to have some of your table cells mixed up.
An example where the side blocks are 150pixels wide and use the same layout for left and right blocks, the layout of a theme looks like:
Code
opentable functions()
themeheader() start
|--------------------------------------------------------------------------|
| Head |
|-------150px------|---------------100%----------------|--------150px------|
| $blocks('left'); | if ($index == 1){ // home page | $blocks('right'); |
| | blocks('centre'); | |
| | } | |
| | themeheader() end, | |
| | themefooter() start | |
|__________________|___________________________________|___________________|
| footmsg(); |
|__________________________________________________________________________|
themefooter() end
themeindex() {
|----------------------------------------|
| $preformat['catandtitle'] |
|----------------------------------------|
| $preformat[searchtopic]; //topic image |
| $preformat['hometext']; |
| $preformat['notes']; |
|----------------------------------------|
} // end themeindex
themearticle() {
|----------------------------------------|
| $preformat['catandtitle'] |
|----------------------------------------|
| $preformat[searchtopic]; //topic image |
| $preformat['fulltext']; |
|----------------------------------------|
} // end themearticle
themesidebox($block) { // in the case where both sides are the same
if ($block['position'] == 'l' or $block['position'] == 'r') {
|-------150px-------|
| $block['title'] |
|===================|
| $block['content'] |
|-------------------|
} elseif ($block['position'] == 'c' { // This is where Admin messages are output
echo " <div class=\"AdminMsg\">$block[content]</div>";
} // End centre Admin block
} // End themesidebox
Excluding the junk filler code of spacer cells often put under the header and between the columns, you've got a fixed-width left cell, a 100%-width cell with center blocks on the home page ($index==1), and right blocks on the home page ($index==1).
Rendered in HTML for legibility:
I've set the styles, such as widths and padding etc in the stylesheet for convenience. It's the last part that's important here.Code
?>
<TABLE width="100%" border="0" cellspacing="2" cellpadding="2" align="center">
<TR>
<TD id="LeftCol" width="150px" valign="top">
<!-- Left blocks -->
<?php blocks('left'); ?>
</TD><!-- end left block -->
<TD id="CenterCol" width="100%" align="center" valign="top">
<?php
if ($index == 1) // If home page
{ blocks('centre'); } // Show Admin messages in center block
} // End of themeheader function
/****************************************************************/
/* function themefooter() */
The centre Admin message is formatted at the end of the themesidebox function, where otherwise the side blocks are. A check for $block['position'] determines if it's a left, right, or centre block (currently, if not left or right, must be centre by default). Usually in themes there's no fancy frames for it, but this is where you'd put it if you want the same frame around it.
In a theme not designed for Admin messages, and where left and right blocks are the same, there may not be any checks for the type of block, so centre blocks are output the same width as a centre block.
A general layout of the themesidebox function is something like this:
Code
If left and right blocks are the same, you may combine them in the one IF statement:
Code
if ($block['position'] == 'l' || $block['position'] == 'r') {
/* Identical left and right block goes here */
} else {
echo $block['content']."<br />";
}
The thing to watch out for is that the number of closing curly braces matches the number of opening ones, ie for every 'if (...) {' there is an ending '}'
Martin :D
- Moderated by:
- Support
