News:

Wondering if this will always be free?  See why free is better.

Main Menu

Adding tables to forum

Started by mmubashar, February 23, 2006, 11:05:33 PM

Previous topic - Next topic

mmubashar

Guys, I just want to add a table in my forum which will have links for advertising. Which file should I edit and what should I do to add the table? I want it to be something like the "News" section and locate it at the bottom of the forum (below the threads and above the copyright). Can anyone guide me on this please?

Your IT-related companion.
Hardware, Network, C, C++, C#, Visual Basic, VB.Net [nofollow], Adobe Imaging, Macromedia Flash, MySQL, Access, HTML, CSS, PHP.

Dannii

Edit index.template.php in the theme directory you want to change
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

mmubashar

#2
Thank you eldacar. Does this means I have to edit ALL index.template.php files in every themes? isnt there any easier way?

assuming i have a page "ad.html" and would want to include it inside the main page, under the boards. Where can I insert the <? include ?> tag?

Your IT-related companion.
Hardware, Network, C, C++, C#, Visual Basic, VB.Net [nofollow], Adobe Imaging, Macromedia Flash, MySQL, Access, HTML, CSS, PHP.

Dannii

It would be simplest to edit every theme. Or you could make a adsinclude.php file and include. Just insert it where you want the ads to be displayed.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

mmubashar

eldacar, im kinda newbie in PHP codes. Can you guide me in adding it please? I just need to insert a small little section under the last table. It could be a table or a div. I tried some, but when i insert the
<? include ('http://domain.com/adfilename.htm' [nofollow]); ?>
the PHP code breaks and the forum gives an error message. Please provide me with a small example. Thanks

Your IT-related companion.
Hardware, Network, C, C++, C#, Visual Basic, VB.Net [nofollow], Adobe Imaging, Macromedia Flash, MySQL, Access, HTML, CSS, PHP.

Dannii

You need to put everything in an echo statement and make sure the quotes are escaped problem.
echo 'This is an example. escaped quote -> /" ';
then in the places where you want it, make sure you are outside that, and then addinclude /path/to/file.php';That is the internal path, not the external url (http).
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

mmubashar

eldacar, sorry for being buggy..I tried it out with this code:

echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td align="left">';
include ../ad.html;';


Im pretty sure that it has something wrong in the code. The table is supposed to be closed. Do I have to make a new echo for the closing of the table? Please help me to correct the code. Thanks.

Your IT-related companion.
Hardware, Network, C, C++, C#, Visual Basic, VB.Net [nofollow], Adobe Imaging, Macromedia Flash, MySQL, Access, HTML, CSS, PHP.

Dannii

include '../ad.html;';
You forgot the first quote
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

mmubashar

Almost there..
I made the adjustments and this is the revised code:
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td align="left">';
include 'ad.html;';
echo '
</td></tr></table>';

However, when it's executed, I get the following:

An error has occured:
template_main_below(ad.html;): failed to open stream: No such file or directory

Alternatively, I have tried the following code for the include:
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td align="left">';
include 'home/shahz/public_html/forum/Themes/XT/ad.html;';
echo '
</td></tr></table>';


But the results remain the same :(

Where am I going wrong?
In the ad.html, here is what contained in it:
<a href="http://www.lineclear.com/">
<img src="http://www.lineclear.com/button.php?u=mmubashar" alt="Best Malaysian Sites" border="0" />
</a>

I think the code in the as.html shouldnt be the problem here. Please guide me. Thanks. Now I at least can see the rest of the contents. Just that it displays the error at the bottom where I locate the code.

Your IT-related companion.
Hardware, Network, C, C++, C#, Visual Basic, VB.Net [nofollow], Adobe Imaging, Macromedia Flash, MySQL, Access, HTML, CSS, PHP.

Dannii

You can't just include html files. You can either include a php file (put everything in ad.html as an echo), or try this:
echo file_get_contents('ad.html');
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

Advertisement: