PHP Web Host - Quality Web Hosting For All PHP Applications Sign up for PayPal and start accepting credit card payments instantly
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
ConViCT
New Member
New Member


Joined: Oct 18, 2002
Posts: 21

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

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: 15057
Location: Kansas

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

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


Joined: Jan 02, 2003
Posts: 2363

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

Some more hints:
Only registered users can see links on this board!
Get registered or login to the forums!
View user's profile Send private message
ConViCT
New Member
New Member


Joined: Oct 18, 2002
Posts: 21

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

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
View user's profile Send private message Visit poster's website
sixonetonoffun
Spouse Contemplates Divorce


Joined: Jan 02, 2003
Posts: 2363

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

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");
}
}
View user's profile Send private message
ConViCT
New Member
New Member


Joined: Oct 18, 2002
Posts: 21

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

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
View user's profile Send private message Visit poster's website
sixonetonoffun
Spouse Contemplates Divorce


Joined: Jan 02, 2003
Posts: 2363

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

You must have figured it out looks fine on your site?
View user's profile Send private message
ConViCT
New Member
New Member


Joined: Oct 18, 2002
Posts: 21

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

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!
View user's profile Send private message Visit poster's website
sixonetonoffun
Spouse Contemplates Divorce


Joined: Jan 02, 2003
Posts: 2363

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

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.
View user's profile Send private message
ConViCT
New Member
New Member


Joined: Oct 18, 2002
Posts: 21

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

I just added that! Thanks so much Six! Very Happy
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2008 by Raven
Proud to be listed at Lobo Links Web Directory

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::

:: fisubice Theme Recoded To 100% W3C CSS & HTML 4.01 Transitional Compliance by Raven and 64bitguy ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum