Author |
Message |
ConViCT
New Member
![New Member New Member](modules/Forums/images/ranks/1star.gif)
![](modules/Forums/images/avatars/094.gif)
Joined: Oct 18, 2002
Posts: 21
|
Posted:
Wed Jul 14, 2004 4:35 pm |
|
Hi There,
I have hit a few sites that display banners in the News Articles themselves (after clicking read more of course), just wondering how I would go about adding this to my site?
Thanks,
ConViCt |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
Site Admin/Owner
![](modules/Forums/images/avatars/45030c033f18773153cd2.gif)
Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Wed Jul 14, 2004 6:22 pm |
|
Just use standard html anchor and image tags in the read more section of the news article. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
sixonetonoffun
Spouse Contemplates Divorce
![](modules/Forums/images/avatars/d1ecfa674c890aee2698b.jpg)
Joined: Jan 02, 2003
Posts: 2496
|
Posted:
Wed Jul 14, 2004 7:19 pm |
|
Some more hints:
http://www.ravenphpscripts.com/posts1423-highlightbanner.html |
_________________ [b][size=5]openSUSE 11.4-x86 | Linux 2.6.37.1-1.2desktop i686 | KDE: 4.6.41>=4.7 | XFCE 4.8 | AMD Athlon(tm) XP 3000+ | MSI K7N2 Delta-L | 3GB Black Diamond DDR
| GeForce 6200@433Mhz 512MB | Xorg 1.9.3 | NVIDIA 270.30[/size:2b8 |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
ConViCT
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Jul 15, 2004 10:37 am |
|
Hi Again,
Well I was able to get a static banner placed on each article, but have been unable get the banners rotating like the others. I read through Six's (Thanks Six!)hints and I added the If statements for the banner to the themearticle() section as well as adding $banners to the globals of this section, but when I use $banners in the Story_Page.html file from my theme, it only prints out a 1. I have attached the code for both the Themearticle() and the Story_Page.html below. Any ideas?
Code:
/************************************************************/
/* Function themearticle() */
/* */
/* This function format the stories on the story page, when */
/* you click on that "Read More..." link in the home */
/************************************************************/
function themearticle ($aid, $informant, $datetime, $title, $thetext, $topic, $topicname, $topicimage, $topictext) {
global $admin, $sid, $tipath, $banners;
$posted = ""._POSTEDON." $datetime "._BY." ";
$posted .= get_author($aid);
if ($notes != "") {
$notes = "<br><br><b>"._NOTE."</b> <i>$notes</i>\n";
} else {
$notes = "";
}
if ("$aid" == "$informant") {
$content = "$thetext$notes\n";
} else {
if($informant != "") {
$content = "<a href=\"modules.php?name=Your_Account&op=userinfo&username=$informant\">$informant</a> ";
} else {
$content = "$anonymous ";
}
$content .= ""._WRITES." <i>\"$thetext\"</i>$notes\n";
}
if ($banners) {
include("banners.php");
echo "<br>";
}
$tmpl_file = "themes/fiblue3d/story_page.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
}
|
Here is my Story_page.html
Code:
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="row1" width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td nowrap><div align="left"><font class="storytitle"><b>$title</b></font><br>
<font class="content">$posted</font></div></td>
</tr>
</table></td>
</tr>
<tr>
<td class="row2"><table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td>
<p><a href="article-topic-.html$topic"><img src="$tipath$topicimage" border="0" alt="$topictext" title="$topictext" align="right" hspace="10" vspace="10"></a><font class="storycontent">$content<br></font></p>
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<CENTER>
<table>
<TR>
<TD><!--Static Banner--!><a href="http://www.Convictradio.com" target="_blank"><img src="http://www.convictradio.com/images/banners/convict_radio.gif" border="0" alt="ConViCtRadio!!"></a></TD>
<TD>$banners</TD>
</TR>
</table>
</CENTER>
|
Thanks so much,
ConViCt |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
sixonetonoffun
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Jul 15, 2004 11:32 am |
|
Try moving it down below the print $r_file;
That theme has a nice random code for the banners in the heder function but it would have been nicer if it was able to be used in the rest of the theme. But this will work ok.
eval($thefile);
print $r_file;
if ($banners==1) {
include("banners.php");
}
} |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
ConViCT
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Jul 15, 2004 11:49 am |
|
Would I then use $banners in the Story_Page.html? I changed the code in Theme.php to show as you mentioned in the last post, but where the banner should be printing on the article it still places a 1 there instread of the banner.
Thanks,
ConViCt |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
sixonetonoffun
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Jul 15, 2004 1:26 pm |
|
You must have figured it out looks fine on your site? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
ConViCT
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Jul 15, 2004 1:36 pm |
|
hmmmm...very strange...when logged in as admin all I see is the 1, when logged in as just a user all I see is the 1, but when I am logged in as Anonymous, I can see the 1 AND the banner! Well, it is displaying for Anonymous users, and that is a start! Thanks Six! |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
sixonetonoffun
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Jul 15, 2004 1:56 pm |
|
Now I have no clue what is causing that but... if you do this instead.
if ( is_user($user) || is_admin($admin)) {
}else{
if ($banners==1) {
include("banners.php");
}
}
It will at least not print anything related to the banners for admin and logged in users. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
ConViCT
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Jul 15, 2004 2:16 pm |
|
I just added that! Thanks so much Six! ![Very Happy](modules/Forums/images/smiles/icon_biggrin.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|