TinyPortal

Development => Support => Installation => Topic started by: shawnlg on October 16, 2007, 10:40:16 PM

Title: Where do I find this in the code and how can insert it in...
Post by: shawnlg on October 16, 2007, 10:40:16 PM
 *********  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!
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on October 18, 2007, 04:56:06 PM
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.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on October 18, 2007, 05:36:55 PM
I will give those a try thank you so much for your help!  You have really been a lot of help!
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on October 18, 2007, 10:45:05 PM
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
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on October 19, 2007, 12:01:26 AM
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
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on October 19, 2007, 12:06:33 AM
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";
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on October 19, 2007, 02:49:17 AM
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.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on October 19, 2007, 04:30:00 AM
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..
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on October 21, 2007, 04:58:00 AM
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
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on October 21, 2007, 05:07:09 AM
If what I'm thinking is what you are asking, it would require you to make a SQL call to get that information.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on October 22, 2007, 03:07:36 AM
Could you give me a direction on how I would learn how to do that ispecifically  with your application.  I would manually do it once but I see that field constantly chaning.  Thanks!
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on October 22, 2007, 03:40:48 AM
Well if you're only going to do it once it will probably be pretty simple. The problem being that if you have another article loaded up on your page, and then you want to grab the rating from another article? I need you to be very specific about what you need so I know what to put in the Database call.

All it is is something like this:

$query = db_query("SELECT tables_rows FROM articles WHERE id = article_id#", __FILE__, __LINE__);

while ($row = mysql_fetch_assoc($query){
    echo $row['rating_stuff'];
}


Thats the basics of it.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on October 22, 2007, 04:18:27 PM
The closest thing I can show you right now it what I am doing..  Check out this link..

http://www.scifiandgod.com/content/index.php?page=Star%20Trek%20-%20The%20Next%20Generation%20-%20The%20First%20Season

You see how there is a list of star trek episodes?  Under the user rating I would like those to be dynamic based on how the author chooses on the article pages.  The list there will all be hyperlinked to a specific article.

There will be one of these pages for each of many programs.  If it not too much trouble if you could give me a step by step process of what to change based on the code you sent me.  Thanks so much for your help.  You have done way more than I expected.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on October 22, 2007, 06:32:34 PM
So basically, you're listing all the shows in your category in the article. You want the list to grab the rating for each article in the category list? Or are you asking for a user to be able to give a rating to your list of shows?
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on October 22, 2007, 06:39:22 PM
Yes, the first one I want to grab the rating in a list format.  The rating will always change based on the feedback I get on the article page.  Thanks!
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on October 22, 2007, 06:52:55 PM
hmm... I'm still not clear on this. The rating, is this the rating that they will give the article? Or a rating that is not built into the TP article?
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on October 22, 2007, 07:00:32 PM
I have changed the text so they are rating the show not the article.  Essentially and normally it would be the article rating I want them to rate the resource not the article though.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on October 23, 2007, 01:17:02 PM
If you're not going to use the rating system from the article to appear there dynamically, then that means you're going to need a custom form for them to be able to vote. Thats what I'm getting at. Which means creating another field or table in the database. Basically, you're looking at another mod or something. At this point, not something I have the time to do.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on October 23, 2007, 05:27:14 PM
I think we are missing each other.  I understand what you are saying about if I was going to use a new form but I am going to use the same form and database call already built in.  I just changed the text on the page for them to think they are voting for the resource not the article..  Look at this page..

http://www.scifiandgod.com/content/index.php?page=Star%20Trek%20-%20The%20Next%20Generation%20-%20The%20Naked%20Now

Do you see where it says on the page "Give this show or movie a rating of".  Normally it would have said give this article a rating of...  Just changed the text so they think they are voting on the show.

I agree the other way would have been a lot more work.  Any good resources that are free on working with php and sql?  I think that will help me immensely.

Shawn Larson
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on October 23, 2007, 07:59:28 PM
No I can't see your text changed as a guest. If you're going to put each show in its own article, and then grab the ratings from each article thats do-able. Let me see what I can do over the next couple days if the Boss lets up on me. :)
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on October 23, 2007, 09:51:32 PM
Thank you!  Your awesome!
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on October 25, 2007, 12:00:24 AM
Can you post the code you have now so I can try to incorporate what you're doing into this?
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on October 25, 2007, 12:31:19 AM
Here is the html code I am using however it will probably need to be in php.

<P>&nbsp;</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<TABLE borderColor=#666666 cellSpacing=0 cellPadding=5 width="95%" border=1>
<TBODY>
<TR bgColor=#333333>
<TD width="14%">Show Number</TD>
<TD width="45%">Episode </TD>
<TD width="17%">Air date</TD>
<TD width="12%"><A href="http://www.scifiandgod.com/content/index.php?page=7">SAG Rating</A></TD>
<TD width="12%"><A href="http://www.scifiandgod.com/content/index.php?page=8">User Rating</A></TD></TR>
<TR>
<TD height=36>#101</SPAN> </TD>
<TD>Encounter At <SPAN class=SpellE>Farpoint</SPAN></SPAN></SPAN> </TD>
<TD>09/28/87</SPAN> </TD>
<TD>N/A</TD>
<TD>N/A</TD></TR>
<TR>
<TD>#102</SPAN> </TD>
<TD>The Naked Now</SPAN></SPAN> </TD>
<TD>10/05/87</SPAN> </TD>
<TD>N/A</TD>
<TD>N/A</TD></TR>
<TR>
<TD>#103</SPAN> </TD>
<TD>Code of Honor</SPAN></SPAN> </TD>
<TD>10/12/87</SPAN> </TD>
<TD>N/A</TD>
<TD>N/A</TD></TR>
<TR>
<TD>#104</SPAN> </TD>
<TD>The Last Outpost</SPAN></SPAN> </TD>
<TD>10/19/87</SPAN> </TD>
<TD>N/A</TD>
<TD>N/A</TD></TR>
<TR>
<TD>#105</SPAN> </TD>
<TD>Where No One Has Gone Before</SPAN></SPAN> </TD>
<TD>10/26/87</SPAN> </TD>
<TD>N/A</TD>
<TD>N/A</TD></TR>
<TR>
<TD>#106</SPAN> </TD>
<TD>Lonely Among Us</SPAN></SPAN> </TD>
<TD>11/02/87</SPAN> </TD>
<TD>N/A</TD>
<TD>N/A</TD></TR>
<TR>
<TD>#107</SPAN> </TD>
<TD>Justice</SPAN></SPAN> </TD>
<TD>11/09/87</SPAN> </TD>
<TD>N/A</TD>
<TD>N/A</TD></TR>
<TR>
<TD>#108</SPAN> </TD>
<TD>The Battle</SPAN></SPAN> </TD>
<TD>11/16/87</SPAN> </TD>
<TD>N/A</TD>
<TD>N/A</TD></TR>
<TR>
<TD>#109</SPAN> </TD>
<TD>Hide and Q</SPAN></SPAN> </TD>
<TD>11/23/87</SPAN> </TD>
<TD>N/A</TD>
<TD>N/A</TD></TR>
<TR>
<TD>#110</SPAN> </TD>
<TD>Haven</SPAN></SPAN> </TD>
<TD>11/30/87</SPAN> </TD>
<TD>N/A</TD>
<TD>N/A</TD></TR>
<TR>
<TD>#111</SPAN> </TD>
<TD>The Big Goodbye</SPAN></SPAN> </TD>
<TD>01/11/88</SPAN> </TD>
<TD>N/A</TD>
<TD>N/A</TD></TR>
<TR>
<TD>#112</SPAN> </TD>
<TD><SPAN class=SpellE>Datalore</SPAN></SPAN></SPAN> </TD>
<TD>01/18/88</SPAN> </TD>
<TD>N/A</TD>
<TD>N/A</TD></TR>
<TR>
<TD>#113</SPAN> </TD>
<TD>Angel One</SPAN></SPAN> </TD>
<TD>01/25/88</SPAN> </TD>
<TD>N/A</TD>
<TD>N/A</TD></TR>
<TR>
<TD>#114</SPAN> </TD>
<TD>11001001</SPAN></SPAN> </TD>
<TD>02/01/88</SPAN> </TD>
<TD>N/A</TD>
<TD>N/A</TD></TR>
<TR>
<TD>#115</SPAN> </TD>
<TD>Too Short a Season</SPAN></SPAN> </TD>
<TD>02/08/88</SPAN> </TD>
<TD>N/A</TD>
<TD>N/A</TD></TR>
<TR>
<TD>#116</SPAN> </TD>
<TD>When the Bough Breaks</SPAN></SPAN> </TD>
<TD>02/15/88</SPAN> </TD>
<TD>N/A</TD>
<TD>N/A</TD></TR>
<TR>
<TD>#117</SPAN> </TD>
<TD>Home Soil</SPAN></SPAN> </TD>
<TD>02/22/88</SPAN> </TD>
<TD>N/A</TD>
<TD>N/A</TD></TR>
<TR>
<TD>#118</SPAN> </TD>
<TD>Coming of Age</SPAN></SPAN> </TD>
<TD>03/14/88</SPAN> </TD>
<TD>N/A</TD>
<TD>N/A</TD></TR>
<TR>
<TD>#119</SPAN> </TD>
<TD>Heart of Glory</SPAN></SPAN> </TD>
<TD>03/21/88</SPAN> </TD>
<TD>N/A</TD>
<TD>N/A</TD></TR>
<TR>
<TD>#120</SPAN> </TD>
<TD>The Arsenal of Freedom</SPAN></SPAN> </TD>
<TD>04/11/88</SPAN> </TD>
<TD>N/A</TD>
<TD>N/A</TD></TR>
<TR>
<TD>#121</SPAN> </TD>
<TD>Symbiosis</SPAN></SPAN> </TD>
<TD>04/18/88</SPAN> </TD>
<TD>N/A</TD>
<TD>N/A</TD></TR>
<TR>
<TD>#122</SPAN> </TD>
<TD>Skin of Evil</SPAN></SPAN> </TD>
<TD>04/25/88</SPAN> </TD>
<TD>N/A</TD>
<TD>N/A</TD></TR>
<TR>
<TD>#123</SPAN> </TD>
<TD>We'll Always Have Paris</SPAN></SPAN> </TD>
<TD>05/02/88</SPAN> </TD>
<TD>N/A</TD>
<TD>N/A</TD></TR>
<TR>
<TD>#124</SPAN> </TD>
<TD>Conspiracy</SPAN></SPAN> </TD>
<TD>05/09/88</SPAN> </TD>
<TD>N/A</TD>
<TD>N/A</TD></TR>
<TR>
<TD>#125</SPAN> </TD>
<TD>The Neutral Zone</SPAN> </TD>
<TD>03/16/88</SPAN> </TD>
<TD>N/A</TD>
<TD>N/A</TD></TR></TBODY></TABLE>
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on October 25, 2007, 12:36:15 AM
Yikes... don't forget to use the code tags when posting code. :) I'm trying to think of a more permanent solution to your show listing/rating. Ideally, I'd like to make a code snippet that you could use that would automatically create a list for you based on the category. You catch my drift? This way, you don't have to make an article and hand write the code to create your table of shows with ratings etc.

Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on October 25, 2007, 12:42:11 AM
That would be awesome!  Thanks..  I am excited about this site.  Since getting started I am going to pull my other sites from phpnuke soon too.  Thanks!
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on October 25, 2007, 01:23:29 AM
One more question: How are you planning to input your SAG rating? Is this something you were going to manually put in?

Reason I ask, is that the fields for air date and SAG are going to have to be grabbed from somewhere. I have an idea on how we can do this using the intro field for articles, but if you are already using the intro then we might not be able to...

I already have a working list of the articles in the category with the user rating. Episode number is automatically put in, as long as it counts normally you shouldn't see no problem. So what I was thinking is to put the SAG rating, and the air date for the episode into the intro box when you create the article. I can then grab that info and have it automatically put in your list.

So far, seems a bit easier than I thought.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on October 25, 2007, 03:46:27 AM
I am not using that other field that is a great idea.  Sounds good lets go for it.

Thanks again for the help!
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on October 25, 2007, 04:19:46 AM
Ok, well here's a rough draft. One thing you have to do if you want your SAG and Air date to be in the list is to add it for each episodes article in this format. Put it in the intro box for the article and don't put anything else in the intro box.
Quote10-23-07|80
Notice the separation with the pipe character. The date will be separated from your SAG rating, which in this case would be 80. :) So put what ever you need for a SAG rating, put it after the pipe.

Change $category to which ever category of articles you need to call for episodes. All your articles/episodes must be in a category for this to work. You can also change the counter for the show number ($episode_num).

If you put this code into an article all you have to do is make small adjustments to make it different for any other shows you choose to do this with. Now, I'll cross my fingers and hope it works for you. :D

global $db_prefix, $scripturl;

// Change the category number to your category ID
$category = 1;

// Change this number to indicate which number the episode count starts
$episode_num = 100;

$query = db_query(
    "SELECT id, subject, intro, rating
     FROM {$db_prefix}tp_articles
     WHERE category = $category
     AND off = 0
     AND approved = 1
     ORDER BY id", __FILE__, __LINE__);
echo '<div style="overflow: auto; width: 100%;">';

echo '<table cellspacing="0" cellpadding="5px" border="1">
<tr>
<th width="14%">Show Number</th>
<th width="45%">Episode </th>
<th width="17%">Air date</th>
<th width="12%"><a href="' .$scripturl. '?page=7">SAG Rating</a></th>
<th width="12%"><a href="' .$scripturl. '?page=8">User Rating</a></th>
</tr>';
while ($row = mysql_fetch_assoc($query)){
$rate = array();
$rate = explode(",", $row['rating']);
$rating_votes = count($rate);

if($row['rating'] == '')
$rating_votes = 0;

$total = 0;
foreach($rate as $mm => $mval)
$total = $total+$mval;

if($rating_votes > 0 && $total > 0)
$rating_average = floor($total/$rating_votes);
else
$rating_average=0;

$sag = array();
if (!empty($row['intro'])){
$sag = explode("|", $row['intro']);
}
else{
$air_date = '';
$sag_rating = '';
}

foreach ($sag as $key => $value){
$air_date = $sag[0];
$sag_rating = $sag[1];
}
  echo '<tr>
  <td width="14%">',$episode_num, '</td>
  <td width="14%"><a href="' . $scripturl . '?page=' . $row['id'] . '">' . $row['subject'] . '</a></td>
  <td width="14%">',$air_date, '</td>
  <td width="14%">',$sag_rating, '</td>
  <td width="14%">',$rating_average, '</td>
  </tr>';
  $episode_num++;
}
echo '</table>';
echo '</div>';


Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on October 25, 2007, 06:01:51 AM
This is too much for my brain tonight.  I will take a look in the morning..  Thanks for your help!
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on October 25, 2007, 11:34:33 PM
Nice job.  I really like how you laid it out..  I don't think I gave you enough information though..  The episode numbers aren't mine but the numbers the shows give out.. 

Because of this the episode number, in the way it was written wont work for a couple different reasons..  One you would need a way to move up or down the articles in order to make the article numbers match the right show.  Second I can almost guarantee that there is going to be some weird show out there that they make their episode numbers go by the thousands or something..  The idea was awesome though and it should work for some other purpose..

Working off your idea to fill the opther unused box here is what I came up with.  Re arrange the order so that you would have the beginning of the table in one box and the end of the table in the other.  In the latter portion of the table put in those formulas that will have to be put in manually like the episode numbers, the sag ratings and the airdate.  The tables cells do not necessarily need to be put in the order that they were placed.

You can see the working model here..
http://www.scifiandgod.com/content/index.php?cat=6

Thanks again for your hard work this is turning out awesome.

Shawn Larson
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on October 25, 2007, 11:45:17 PM
Well I had a feeling we'd have to tweak it to make it more to your liking. But if you got a handle on it all the better. :up: Having things automated is so much nicer. :) If you need anything else feel free to ask.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on October 25, 2007, 11:52:08 PM
I will try to tweak it.  I am a little unsure though how to put the two fields together.  I guess what I am saying I still need some help...  I really do appreciate all the support you have given me.  As soon as I get this part to work I think I can get this site online.  You have really gone over the top helping and I appreciate it.  BTW how are you guys making money off this?  How can I support you guys in the future?
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on October 26, 2007, 12:14:44 AM
I don't plan to make any money doing this until I am pretty fluent in PHP. It may appear that I am, but I assure you I still have a long way to go with things. Until I understand the user system and permissions in SMF I think... which I haven't even touched yet. lol As for supporting us, there's a donate block on the leftside you can donate to TinyPortal if you wish. Or purchase a theme etc. Its really up to you.

For controlling the episode you can just add the episode number to the intro field as well. Make sure you use the pipe to separate it as thats what the PHP I setup is looking for to separate things.

date|sag_rating|episode_number

Delete this code since you don't need the auto episode number.

// Change this number to indicate which number the episode count starts
$episode_num = 100;

also delete this line below:

$episode_num++;


Then change this code:
else{
$air_date = '';
$sag_rating = '';
}


To this:
else{
$air_date = '';
$sag_rating = '';
                $episode_num = '';
}


And change this code:
foreach ($sag as $key => $value){
$air_date = $sag[0];
$sag_rating = $sag[1];
}


To this code:
foreach ($sag as $key => $value){
$air_date = $sag[0];
$sag_rating = $sag[1];
                $episode_num = $sag[2];
}


That should do it. Is there anything else I'm missing here? Didn't get much more out of your description of the changes you needed.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on October 26, 2007, 08:24:47 PM
I made the changes and by putting text into the extra box (Intro Text), however it only fills one box with code as you can see from this example.

http://www.scifiandgod.com/content/index.php?cat=6

Is there something special I am supposed to be putting in that extra field (Intro Text) in order to make it come out correctly?  Thanks again for your help!
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on October 26, 2007, 11:15:58 PM
hmm... I'd need to take a look at it. You mind PM'ing me some info to look at it?
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on October 26, 2007, 11:22:51 PM
Sure..  Thank you!
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on October 26, 2007, 11:58:57 PM
hmm... one thing I did not notice which is kind of limiting. PHP articles do not have the intro option. So if you want this to work the articles that are called with this code will have to be regular articles and not php articles. Sorry about that, I didn't realize that was the case as I don't do a lot with articles on my sites. You can see the test article that I put in there.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on October 27, 2007, 12:02:38 AM
The only way I got it to work before is do it in html first then swith to php on the next screen.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on October 27, 2007, 12:04:45 AM
How did you get yours to work.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on October 27, 2007, 12:09:24 AM
I just made an regular article. Click add on the article screen and you'll see the intro box in a regular article edit screen. If you edit my article you can see how I did it.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on October 27, 2007, 12:16:23 AM
All it says in the box is this is for testing purposes.  I switched to php and nothing.  An I missing something?
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on October 27, 2007, 12:35:45 AM
Yes, you'll need to set your articles up just like I did the test article. Put a title in the top, the body of the article will contain the info about the show. The intro will contain the date|sag_rating|episode_number.

Then you use the php article with the code I provided to call the articles in the list.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on October 27, 2007, 12:40:44 AM
Got it..  I will play with it this weekend and start adding the shows.  Thanks!
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on October 28, 2007, 05:54:59 AM
Looks like it is working great.  Can you help me find a formating issue on the page?  I want the whole table to show up underneath the star trek pic.

Please let me know what i am missing.

One more thing.  How easy do you think it would be for me to go into my sql and populate these articles.  My goal right now is to basically make the format a template for all the shows then go back and do the review after I have all of the articles up.  This way even while I am getting to the article the user still has a chance to comment on the show.  If I can figure out an easy way to put all of the articles up with the few exceptions like the show name and number it will be the same until I go and add content later.  Let me know what you think and if this even makes sense.

Thanks!!
Shawn Larson
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on October 28, 2007, 12:21:51 PM
I fixed the table to be underneath the category icon. As for what you're asking about using MySQL or phpMyAdmin I don't quite get what you're asking. I don't think you could make it automated if thats what you're asking. At least at this point, I can't think of a way.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on October 28, 2007, 09:39:09 PM
Yeah I think you know what I mean about automating it..  It would be great to see something like an easy populate similar to oscommerce.  What I was thinking was to down load the individual table and manually imput the information that way.  I dont know what each of the fields represent and how they are populated to do it manually..  Maybe I can have someone setup a script client side that will just input the script over and over or something.  With as many shows that star trek has alone it could take forever.  No worries I will figure it out.

You have been awesome and I appreciate your help!  PS Could you recomend a template that I can manually put in a header instead of using the style sheet method.  Thanks!

Shawn Larson
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on October 29, 2007, 02:11:16 AM
I don't know of any templates that make it that easy. You'll find that quite a lot of the themes already on this site have already had people ask to put a logo in the top if you search the posts in the respective boards/topics. Just post in the theme topic or ask the author of the theme if you get stuck.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on November 15, 2007, 11:21:57 PM
I got pulled off this project but I am back. Two questions based on what we have talked about so far.

1. Do you know if there is something out there that will take the articles and arrange them in a sort order?  If not is that difficult?

2. Anybody know of a form processor program or script that would allow me to generate 50 of the same article then I would go back and make the necessary changes to the article, because most of the content stays the same.  Thanks!
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on November 15, 2007, 11:30:28 PM
There are no sorting features built into the article system until TP 1.0 (besides changing the date manually one by one).

There no form that can do this made, yet. I might be able to take a look at that this weekend if I get some time.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on November 16, 2007, 12:37:36 AM
When is the new TP coming out.  I am planing on adding tp to about 30 sites and may wait until it is finished.  Thanks!
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on November 16, 2007, 12:39:52 AM
I think the date thing could work till there is a sort order.  Thanks!
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on November 16, 2007, 01:15:19 AM
The release date will never EVER be a set date. As its done on spare time from Bloc. As its been said many times before, it will only be ready when its ready. :)
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on November 16, 2007, 01:20:53 AM
Please let me know when you are going to dev test it.  I would be happy to be a guinea pig.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on November 16, 2007, 01:27:53 AM
We always alpha test with select a select group of people first. And then release to the public as beta test. To be on the alpha team you need to know what you are doing. If so, you'll be noticed by the team, and possibly invited if so. Only by invitation though.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on November 16, 2007, 01:35:36 AM
Ok I understand.  I am an IA by trade and may be able to help that way.  let me know..

Thanks,
Shawn Larson
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on November 16, 2007, 03:41:30 AM
HELP!

I need help fixing the code you designed for me.  The master article with the table of all the article listings isnt working now.  I would restore from a backup but I dont know if I need to restore it from the database or the files.  Please help!
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on November 16, 2007, 04:03:18 AM
The code I gave you is in this very topic. Just open the article and paste the code again.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on November 16, 2007, 04:19:06 AM
lol..  too much stress..  Thanks..

Shawn Larson
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on November 16, 2007, 07:01:52 AM
Ok..  Great worked well to get everything back to where it was however, you did something else to make the table appear below the image.  How can I do that?  Thanks again!
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on November 16, 2007, 02:46:51 PM
I can't remember. I think I added a < br /> tag after it to make it return to the next line.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on November 16, 2007, 03:32:03 PM
I tried that, could you take a quick look?  It seems as though it is in the backend because based on the html tags there does not seem to be any tags that would cause it to do this.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on November 16, 2007, 03:40:09 PM
I don't have your login info anymore to look at it. Can you PM that to me again please.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on November 16, 2007, 08:04:03 PM
Wierd it doesnt show below the category picture for me.  Do I need to do something?
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on November 16, 2007, 08:17:25 PM
One more thing...  Do you know how the articles are sorted in the table?  Do you think we could sort them by the air date or show number?  Thanks!
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on November 16, 2007, 11:40:36 PM
For now the articles are sorted by the ID. Which means you should create them in order starting from the first episode to the last episode.

Is the article not displaying properly for you still?
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on November 16, 2007, 11:54:56 PM
This is what I see..

http://www.scifiandgod.com/whatisee.jpg

As you can see I still see the table right next to the category image.  Thanks!
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on November 17, 2007, 12:17:42 AM
Thats internet exploder for ya. In Firefox it looks just fine. Not sure how to get it to work right now, as IE doesn't have any good features to make it easy to edit things as you see them. If I figure it out I'll post back.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: Xarcell on November 17, 2007, 01:00:55 AM
What is the he's using?
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on November 17, 2007, 03:13:36 AM
Just an article. Its assigned to the category which puts the category icon in the upper left of the article. Putting content in it put the content to the right of the category icon. Added a float: left; to the style and it works in FF. But can't figure out IE just yet.

http://www.scifiandgod.com/content/index.php?cat=6
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on November 20, 2007, 04:30:23 AM
This is a little over my head with css but couldnt we us an absolute position in css like you use with the rest of the template?  Please let me know what you think.  Thanks!
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on November 20, 2007, 05:28:28 AM
Take a look... it is messy code but it works.  I figured out how to do the css and added the code based on how you did it and it works.

Going back to the sort order.  If have already created the articles will I need to go into the the sql in order to postion them correctly?  Is there a quick fix for this?  Please let me know.  Thanks!
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on November 20, 2007, 01:22:20 PM
It might work if you change the ORDER by clause to sort by subject instead of id. Give it a shot.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on November 20, 2007, 05:27:26 PM
How do you suggest I do that. 

This is me--->   :uglystupid2:


Thanks!
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on November 20, 2007, 05:52:20 PM
haha. Look at the db_query() function in the code. You'll notice towards the end of that function is says ORDER by id. Change it to ORDER by subject.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on November 20, 2007, 06:33:50 PM
Thanks!  I am sure that will work great.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on November 20, 2007, 07:06:40 PM
Do you think I could sort it by airdate or show number?
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on November 20, 2007, 08:30:11 PM
Well, more code would have to be made to do that. I'll think on it, and see if I can figure out how that could work. Will post back if I come up with something.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on November 20, 2007, 10:05:24 PM
I think I figured out an easy way to do it but I am not sure how.  I changed the sort to by intro.  From their if we can rearange the fields so that the show number is the first one shown in the intro box I think this should work.  Let me know what you think..
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on November 20, 2007, 10:32:12 PM
Ok I figured out from your code how to rearange things so that it would work.  I think I am finally catching on a little to what you did.  Thanks!
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on November 20, 2007, 11:39:14 PM
haha, well thats how you learn. Jump in up to your neck and try to dig your way out. :D Good work man.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on November 20, 2007, 11:44:21 PM
Thanks!  As I said all this has lead me to wanting to learn sql and javascript

When I get some of these projects off my plate I am going to start taking some courses.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on November 28, 2007, 02:49:39 PM
I am going crazy now.  Now when I go look at the articles instead of seeing an article I see html code.  Not sure if permissions got messed up or what but it is not working now.  Please help!

Look at this page for example..

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

Please feel free to look at the backend to see if some how the code got changed.

Thanks!
Shawn Larson
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on November 28, 2007, 03:10:36 PM
Nevermind I think I fixed it. Thanks!
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on November 28, 2007, 05:15:33 PM
I made a design change and order to make it look right on the page and now the user rating isnt working.  Can you give me an idea how you formated the code so that I can know how to change it to make it work.  Below are the pages affected..

http://www.scifiandgod.com/content/index.php?cat=11
http://www.scifiandgod.com/content/index.php?page=36

Thanks again for all your help..  PS I figured out way to make large scale article changes by using php mysql and a php mysql manager.  Works great!
Title: Re: Where do I find this in the code and how can insert it in...
Post by: IchBin on November 28, 2007, 11:48:20 PM
Its because you moved the array declaration. You had stuff being put into the array before it was declared an array.

You had this:
$rate = explode(",", $row['rating']);
$rate = array();
$rating_votes = count($rate);


When it should have been this:
        $rate = array();
        $rate = explode(",", $row['rating']);
$rating_votes = count($rate);


I fixed your first page. But the second link you posted did not have the problem or the code you are using.
Title: Re: Where do I find this in the code and how can insert it in...
Post by: shawnlg on November 28, 2007, 11:55:34 PM
Got it...  Thanks!

or this.. rating_average

I think I lost this when I went to an earlier backup.  Thanks for your help again!