viewtopic
will have many poster ids. What is it you're trying to actually accomplish?In the statistics of the user (messages,inscription date, etc.), I want to add one more statistic, but external..
{postrow.POSTER_ID}
. Not sure how you plan on reading that in your script.Yes.. But I don't know how to get this value.. I've try with $postrow['POST_AUTHOR_FULL'], with $postrow->POST_AUTHOR_FULL.. But not work..!
Viewtopic_body contains post in a topic, so it's not improbable that there will be many different authors (members). As implied by kinerity you'll have to write some kind of itteration running through each postrow, checking the value you need (either user_id or username (or ... _clean) and when you get a hit, then execute some more code. Also keep in mind that when viewing a topic, you are actually only viewing 1 page (of possibly more depending on the setting of the number of posts per page.
Yes..warmweer wrote: ↑Wed Jan 24, 2018 11:49 am Viewtopic_body contains post in a topic, so it's not improbable that there will be many different authors (members). As implied by kinerity you'll have to write some kind of itteration running through each postrow, checking the value you need (either user_id or username (or ... _clean) and when you get a hit, then execute some more code. Also keep in mind that when viewing a topic, you are actually only viewing 1 page (of possibly more depending on the setting of the number of posts per page.
For more precise help, you'll have to explain a little better on what you want to do exactly.
Is it adding an external statistic about a user_id into each postrow in viewtopic_body.html?
Too busy for such a simple operation..kinerity wrote: ↑Wed Jan 24, 2018 1:35 pm Why not just add the coins field to the USERS_TABLE? Then you could write an extension (take a look at how my Best Answer extension adds the "Answers" field to viewtopic mini profiles).
Same as you
Code: Select all
//Inizio, Cerco i FC in base all'id utente
$sql = "SELECT coins FROM g_giocatori WHERE id = $poster_id";
$result = $db->sql_query($sql);
$FC = (int) $db->sql_fetchfield('coins');
$db->sql_freeresult($result);
//Fine, Cerco i FC in base all'id utente
$post_row = array(
'FC' => ($FC > 0) ? $FC : false,.
Code: Select all
<!-- IF postrow.FC -->
<dd><strong>FC:</strong> {postrow.FC}<img src='https://www.pronosticiippica.it/images/fanta_ippica/coin_min.png' title='Fanta Coin'></dd>
<!-- ENDIF -->