Adding Banner To PHP Based File...

Discussion in 'PHP' started by activebiz, Sep 22, 2008.

  1. #1
    How do I add a banner to a PHP based file? I try to enter plain HTML and it keeps giving my an error on one line or another and I can't figure it out. So now how would I add a banner using PHP so everything works properly? By the way I am using PHP-Fusion.
     
    activebiz, Sep 22, 2008 IP
  2. Funk-woo10

    Funk-woo10 Peon

    Messages:
    1,108
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #2
    could you post some code, i.e where you want to add the image ? Its very simply...need to see some code really.
     
    Funk-woo10, Sep 22, 2008 IP
  3. zerxer

    zerxer Peon

    Messages:
    368
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I don't know what PHP Fusion is but when adding raw HTML to a PHP page, you have to make sure it's not inside any of the <?php ?> tags. If it is, simply put one of the following instead:
    ?><img src="your banner" /><?
    //OR
    echo '<img src="your banner" />';
    //OR
    print '<img src="your banner" />';
    PHP:
    The first one will close the PHP tags and put out the HTML and then reopen them while the other two will simply use the PHP commands echo or print to output the HTML.
     
    zerxer, Sep 22, 2008 IP
  4. activebiz

    activebiz Banned

    Messages:
    1,683
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Here is the code I am trying to work on...

    $res = 0;
    if (dbrows($result) != 0) {
    	$data = dbarray($result);
    	if (checkgroup($data['article_cat_access'])) {
    		$res = 1;
    		if ($rowstart == 0) $result = dbquery("UPDATE ".$db_prefix."articles SET article_reads=article_reads+1 WHERE article_id='$article_id'");
    		$article = stripslashes($data['article_article']);
    		$article = explode("<--PAGEBREAK-->", $article);
    		$pagecount = count($article);
    		$article_subject = stripslashes($data['article_subject']);
    		$article_info = array(
    			"article_id" => $data['article_id'],
    			"user_id" => $data['user_id'],
    			"user_name" => $data['user_name'],
    			"article_date" => $data['article_datestamp'],
    			"article_breaks" => $data['article_breaks'],
    			"article_comments" => dbcount("(comment_id)", "comments", "comment_type='A' AND comment_item_id='".$data['article_id']."'"),
    			"article_reads" => $data['article_reads'],
    			"article_allow_comments" => $data['article_allow_comments']
    		);
    		render_article($article_subject, $article[$rowstart], $article_info);
    		if (count($article) > 1) {
    			$rows = $pagecount;
    			echo "<div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,1,$rows,3,FUSION_SELF."?article_id=$article_id&amp;")."\n</div>\n";
    
    	
    		
    
    		}
    		if ($data['article_allow_ratings']) showratings("A",$article_id,FUSION_SELF."?article_id=$article_id");
    	}
    }
    if ($res == 0) redirect("articles.php");
    Code (markup):
    I want the banner above the rating code but below the main article if you get what I am saying. Here is the link to a sample of what i am talking about:

    http://www.tvshowrush.com/readarticle.php?article_id=1

    So above the blue bar but below the posted by part. How could I add this?
     
    activebiz, Sep 22, 2008 IP
  5. Funk-woo10

    Funk-woo10 Peon

    Messages:
    1,108
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #5
    hmm ok could you not just insert- echo "<img src="IMAGE PATH.JPG" />";

    Before if ($res == 0) redirect("articles.php");

    Im 100% sure how the code lays out the page but try moving it around.
     
    Funk-woo10, Sep 22, 2008 IP
  6. Funk-woo10

    Funk-woo10 Peon

    Messages:
    1,108
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #6
    hmm ok could you not just insert- echo "<img src="IMAGE PATH.JPG" />";

    Before if ($res == 0) redirect("articles.php");

    Im 100% sure how the code lays out the page but try moving it around.

    edit - be sure not to mess up your if statements
     
    Funk-woo10, Sep 22, 2008 IP
  7. activebiz

    activebiz Banned

    Messages:
    1,683
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Thanks Funk-woo10 and Zerxer for the help... Finally got it to work :)
     
    activebiz, Sep 22, 2008 IP