TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

April 19, 2024, 09:27:17 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,165
  • Total Topics: 21,219
  • Online today: 266
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 168
  • Total: 168

Where do I find this in the code and how can insert it in...

Started by shawnlg, October 16, 2007, 10:40:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

shawnlg

 *********  28 Views | 0 Comments | Rating: 7 (2 rates) ********

Where can I find this code and how can I add it somewhere else on my page?  Any suggestions?   The answer to the two questions I currently have on the forums will allow the completion of my site.  Unfortunately I am under a deadline on this to get it setup.  Any help would be appreciated. Thanks for your help!

To show you exactly what I want to do look at this page.  I want to put the accumulative rating, in the example above "7" in the user rating box on this page..

http://www.scifiandgod.com/content/index.php?page=9

Thanks for your help!

IchBin

The code you're looking for is in the TPortal.template.php file. Search for this code // ..and for views and ratings , even comments? and you'll find the code below it that creates that line of text.

I think you're looking for the php variable $story['rating_votes'] for your box.

You'll should be able to add that to your article.

shawnlg

I will give those a try thank you so much for your help!  You have really been a lot of help!

shawnlg

Please check out this page...  I put your code in betwen two echo lines of code that were closed...  Is this supposed to go into strait html or am I doing something wrong...

http://www.scifiandgod.com/content/index.php?page=9

IchBin

If you want to call a variable to dynamically fill your box you're article with have to be PHP. Then you put your html into PHP and call the variable. If you don't know how to do PHP, I would suggest reading up on the echo statment at www.php.net. I also have a small tutorial on my www.ichbin.us

shawnlg

Ok this is how I did it.  I know that the echo command just prints the html command or any text.  I tried to imbed it inbeteen the two commands.  Any suggestions?  I am still learning PHP..

echo "Name of Show
\n";
echo "Star Trek Next Generation: Encounter At Farpoint
\n";
echo "
\n";
echo "Written By
\n";
echo "D.C. Fontana and Gene Roddenberry
\n";
echo "
\n";
echo "Directed By
\n";
echo "Corey Allen
\n";
echo "
\n";
echo "<table width=\"95%\" border=\"1\" align=\"center\" cellpadding=\"5\" cellspacing=\"0\" bordercolor=\"#666666\">\n";
echo "  <tr bgcolor=\"#333333\"> \n";
echo "    <td width=\"22%\">Show Number</td>\n";
echo "    <td width=\"33%\">Episode
 </td>\n";
echo "    <td width=\"32%\">Air date</td>\n";
echo "    <td width=\"13%\"><a href=\"http://www.scifiandgod.com/content/index.php?page=7\">SAG \n";
echo "      Rating</a></td>\n";
echo "    <td width=\"13%\"><a href=\"http://www.scifiandgod.com/content/index.php?page=8\">User \n";
echo "      Rating</a></td>\n";
echo "  </tr>\n";
echo "  <tr> \n";
echo "    <td>#101</td>\n";
echo "    <td>Encounter At Farpoint</td>\n";
echo "    <td>09/28/87
</td>\n";
echo "    <td>N/A</td>\n";
echo "    <td>$story['rating_votes'];
echo "   </td>\n";
echo "  </tr>\n";
echo "</table>\n";
echo "
\n";
echo "Synopsis
\n";
echo "N/A
\n";
echo "
\n";
echo "Critique
\n";
echo "N/A
\n";
echo "
\n";
echo "Key Themes
\n";
echo "N/A
\n";
echo "
\n";
echo "Challenging Topics
\n";
echo "N/A
\n";
echo "
\n";
echo "Intersecting Ideas & Opposing World Views
\n";
echo "N/A
\n";
echo "
\n";
echo "Topical Questions
\n";
echo "N/A\n";

IchBin

For more consistent code format with SMF this is how I would do it.

echo 'Name of Show <br />
Star Trek Next Generation: Encounter At Farpoint<br /><br />
Written By<br />
D.C. Fontana and Gene Roddenberry<br /><br />
Directed By<br />
Corey Allen<br /><br />
<table width="95%" border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#666666">
  <tr bgcolor="#333333">
    <td width="22%">Show Number</td>
    <td width="33%">Episode
    </td>
    <td width="32%">Air date</td>
    <td width="13%"><a href="http://www.scifiandgod.com/content/index.php?page=7">SAG
      Rating</a></td>
    <td width="13%"><a href="http://www.scifiandgod.com/content/index.php?page=8">User
      Rating</a></td>
  </tr>
  <tr>
    <td>#101</td>
    <td>Encounter At Farpoint</td>
    <td>09/28/87</td>
    <td>N/A</td>
    <td>',$story['rating_votes'],'
   </td>
  </tr>
</table>
<br />
Synopsis
<br />
N/A
<br />
echo "Critique
<br />
N/A
<br />
Key Themes
<br />
<br />
Challenging Topics
<br />
N/A
<br />
Intersecting Ideas & Opposing World Views
<br />
N/A
<br />
<br />
Topical Questions
<br />
N/A';


You may need less or more of the break tags so you can change what you need. An echo for each line is really overkill as you can tell. :) See if this works for you.

shawnlg

Worked great..  The only thing I changed was was rating_votes to rating_average.  It helped me to look at your example; I now think I have an idea of how to do something like this in the future.  Thanks so much for the help!  Solved..

shawnlg

I was wondering if there was a way of taking that rating average for a specific article referenced from another page.

Here is what I am doing.  I am creating an index page for all the episodes for a season.  I would like to be able to reference the article rating average next to the episode.  Please let me know if this makes sense.

Shawn Larson

IchBin

If what I'm thinking is what you are asking, it would require you to make a SQL call to get that information.