TinyPortal

Development => Support => Topic started by: fotografo74 on May 19, 2010, 10:40:40 AM

Title: PHP articles, query title and problems
Post by: fotografo74 on May 19, 2010, 10:40:40 AM
Hi :-)
First, sorry for my bad english  :(
I have a problem with Php articles and query titles: i have created various Php articles for insects classification and all articles have query title, but i have always the page number, not the query title in article's url and the article body not shows, i have only the Back button.

The code:


global $user_info,$smcFunc;
if(isset($_GET['identificativo']))
{
$query = "SELECT * from {db_prefix}classificazione_specie where ID=".$_GET['identificativo'];
$dbresult1 = $smcFunc['db_query']('', $query);
while ($row1 = $smcFunc['db_fetch_assoc']($dbresult1))
{
$query = "SELECT * from {db_prefix}classificazione_ordine where ID=".$row1['ID_Ordine'];
$dbresult2 = $smcFunc['db_query']('', $query);
if($row2 = $smcFunc['db_fetch_assoc']($dbresult2))
{
echo '<p><strong>Ordine: </strong>'.$row2['Descrizione'];
}
$query = "SELECT * from {db_prefix}classificazione_famiglia where ID=".$row1['ID_Famiglia'];
$dbresult2 = $smcFunc['db_query']('', $query);
if($row2 = $smcFunc['db_fetch_assoc']($dbresult2))
{
echo ' <strong>Famiglia: </strong>'.$row2['Descrizione'].'</p>';
}
echo '<p><strong>Nome:</strong></p>';
echo '<i>'.$row1['Nome'].'</i>';
echo '<p><strong>Descrizione</strong></p>';
echo $row1['Descrizione'];
echo '<p><strong>Habitat</strong></p>';
echo $row1['Habitat'];
echo '<p><strong>Periodo di attività</strong></p>';
echo $row1['Periodo_volo'];
echo '<p><strong>Distribuzione italiana</strong></p>';
echo $row1['Distribuzione'];
echo '<p><strong>Colore</strong></p>';
echo $row1['Colore'];
echo '<p><strong>Autore scheda</strong></p>';
echo $row1['Autore'];
echo '<br /><p>';
if ($row1['foto1']!= "")
{

echo '<a href="http://www.macroforum.org/'.$row1['foto1'].'" class="highslide" rel="highslide"><img src="'.$row1['foto1'].'" style="height:150px;" /></a>';
}
if ($row1['foto2']!= "")
{
echo '<a href="http://www.macroforum.org/'.$row1['foto2'].'" class="highslide" rel="highslide"><img src="'.$row1['foto2'].'" style="height:150px;" /></a></br >';
}
if ($row1['foto3']!= "")
{
echo '<a href="http://www.macroforum.org/'.$row1['foto3'].'" class="highslide" rel="highslide"><img src="'.$row1['foto3'].'" style="height:150px;" /></a></br >';
}
if ($row1['foto4']!= "")
{
echo '<a href="http://www.macroforum.org/'.$row1['foto4'].'" class="highslide" rel="highslide"><img src="'.$row1['foto4'].'" style="height:150px;" /></a></br >';
}
if ($row1['foto5']!= "")
{
echo '<a href="http://www.macroforum.org/'.$row1['foto5'].'" class="highslide" rel="highslide"><img src="'.$row1['foto5'].'" style="height:150px;" /></a></br >';
}
}
$userid = $user_info['id'];
$query = "SELECT * from {db_prefix}classificazione_utenti where ID ='".$userid."'";
$dbresult2 = $smcFunc['db_query']('',$query);
if ($row1 = $smcFunc['db_fetch_assoc']($dbresult2))
{
//Se ho un risultato mostro il pulsante per l'edit
echo '<p><a href="http://www.macroforum.org/index.php?page=modifica_scheda&id='.$_GET['identificativo'].'">Modifica scheda</a></p>';
}
}
echo '<br /></p><p><a href="javascript:history.go(-1)">Back</a>
</p>';


The same code in SimpelPortal php pages is ok and this is the page: http://www.macroforum.org/index.php?page=descrizione

Help me please? In my new forum, for upgrade to SMF RC3, i have installed TP 1 beta 5.1

Antonio
Title: Re: PHP articles, query title and problems
Post by: IchBin on May 19, 2010, 03:08:24 PM
Sorry but I do not understand your problem. Can you give a link to some examples with your problem?
Title: Re: PHP articles, query title and problems
Post by: fotografo74 on May 19, 2010, 04:20:43 PM
Sorry IchBin, but the new forum is now visible only with modify of host files ( etc/hosts )...is not live forum now, i'm testing.
I have attached screenshot: the body article is missing and the url shows always the page number...not the query title.
If you want modify the hosts files i can you give IP server address.
Thanks
Antonio
Title: Re: PHP articles, query title and problems
Post by: IchBin on May 19, 2010, 06:11:16 PM
If the body of your articles isn't showing, it's likely that the code is having a problem. Have you check the error_log for apache to see what happens when you go to the article page? Query title will only show if you actually create the link to go to the query title. If you are just clicking to it from admin, it will show the ID instead.
Title: Re: PHP articles, query title and problems
Post by: fotografo74 on May 20, 2010, 07:23:22 PM
Quote from: IchBinâ„¢ on May 19, 2010, 06:11:16 PM
If the body of your articles isn't showing, it's likely that the code is having a problem. Have you check the error_log for apache to see what happens when you go to the article page? Query title will only show if you actually create the link to go to the query title. If you are just clicking to it from admin, it will show the ID instead.
Ok, but in SMF RC2 and Simple Portal the article works perfectly, in SMF RC3 and TP 1.0 beta 5-1 the same code not works....:-(
Title: Re: PHP articles, query title and problems
Post by: IchBin on May 20, 2010, 10:29:52 PM
Again...... have you checked the error_log to see what the error is? I'm not going to do all the work for you sorry, I don't have the time.
Title: Re: PHP articles, query title and problems
Post by: fotografo74 on May 23, 2010, 01:21:33 PM
Quote from: IchBinâ„¢ on May 20, 2010, 10:29:52 PM
Again...... have you checked the error_log to see what the error is? I'm not going to do all the work for you sorry, I don't have the time.
Sorry IchBin, the problem was in my code! :-(
Sorry again
Antonio