Page 1 of 1

positioning and printing the function results?

Posted: Thu Oct 01, 2009 10:53 am
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;
  }

Re: positioning and printing the function results?

Posted: Thu Oct 01, 2009 12:46 pm
by requinix
I'd bet that the rating() is supposed to go inside the <div>.

Re: positioning and printing the function results?

Posted: Thu Oct 01, 2009 2:21 pm
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.

Re: positioning and printing the function results?

Posted: Thu Oct 01, 2009 3:37 pm
by requinix
What's the HTML source for the page around that area?