Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.2
Author Message
ConViCT
New Member
New Member



Joined: Oct 18, 2002
Posts: 21

PostPosted: Wed Jul 14, 2004 4:35 pm Reply with quote

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
 
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Wed Jul 14, 2004 6:22 pm Reply with quote

Just use standard html anchor and image tags in the read more section of the news article.
 
View user's profile Send private message
sixonetonoffun
Spouse Contemplates Divorce



Joined: Jan 02, 2003
Posts: 2496

PostPosted: Wed Jul 14, 2004 7:19 pm Reply with quote

Some more hints: [ Only registered users can see links on this board! Get registered or login! ]

_________________
[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 
View user's profile Send private message
ConViCT







PostPosted: Thu Jul 15, 2004 10:37 am Reply with quote

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&amp;op=userinfo&amp;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
 
sixonetonoffun







PostPosted: Thu Jul 15, 2004 11:32 am Reply with quote

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");
}
}
 
ConViCT







PostPosted: Thu Jul 15, 2004 11:49 am Reply with quote

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
 
sixonetonoffun







PostPosted: Thu Jul 15, 2004 1:26 pm Reply with quote

You must have figured it out looks fine on your site?
 
ConViCT







PostPosted: Thu Jul 15, 2004 1:36 pm Reply with quote

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!
 
sixonetonoffun







PostPosted: Thu Jul 15, 2004 1:56 pm Reply with quote

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.
 
ConViCT







PostPosted: Thu Jul 15, 2004 2:16 pm Reply with quote

I just added that! Thanks so much Six! Very Happy
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.2

View next topic
View previous topic
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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©