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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 728
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 462
  • Total: 463
  • @rjen

PHP articles, query title and problems

Started by fotografo74, May 19, 2010, 10:40:40 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

fotografo74

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

IchBin

Sorry but I do not understand your problem. Can you give a link to some examples with your problem?

fotografo74

#2
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

IchBin

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.

fotografo74

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....:-(

IchBin

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.

fotografo74

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

This website is proudly hosted on Crocweb Cloud Website Hosting.