positioning and printing the function results?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lootherx
Forum Newbie
Posts: 2
Joined: Wed Sep 30, 2009 2:20 pm

positioning and printing the function results?

Post by lootherx »

Image

I i'm trying to call a function in another folder/file.php which prints star rating system on my website. this works fine with the below code. but the problem is I can't make it print on the exact place I want to. I need to print my star rating just after the "print | email" option like so "print | email | star rating". how can this be done? below code gives me the 3rd result in the image above.

my code:

Code: Select all

    function rating(){
        require ("plugins/p161_category_ratings/ratings.php");
        }
  // display  date?
  if($article['settings'] & $p2_articlebitfield['displaycreateddate'])
  {
    echo '<div><font size="2">'. $p2_language['published'] . '&#58; '  . ($article['datestart'] > 0 ? DisplayDate($article['datestart']) : DisplayDate($article['datecreated'])).'&#32;&#124;&#32;'.$article['views'] . ' ' . $p2_language['views'].'&#32;&#124;&#32;'."<a href=\"" . $sdurl . 'plugins/p'.$p2_pluginid.'_news/printarticle.php?p'.$p2_pluginid.'_articleid=' . $article['articleid'] . '" target="_blank">' . $p2_language['print'] . '</a>'. ' &#124; '."<a href=\"". RewriteLink('index.php?categoryid=' . $categoryid . '&p'.$p2_pluginid.'_aid=' .
      $article['articleid'] . '&p'.$p2_pluginid.'_action=emailarticle') . '">' . $p2_language['email'] ."</a>".'</font></div>'; 
    rating();
    $displaylinebreaks = true;
  }
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: positioning and printing the function results?

Post by requinix »

I'd bet that the rating() is supposed to go inside the <div>.
lootherx
Forum Newbie
Posts: 2
Joined: Wed Sep 30, 2009 2:20 pm

Re: positioning and printing the function results?

Post by lootherx »

I tried that too. when i call the function inside the <div> tags, the rating prints on that line but creates a line break. ie. goes on top of the " Print | Email " option. the last result on the image above shows this.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: positioning and printing the function results?

Post by requinix »

What's the HTML source for the page around that area?
Post Reply