darnoldy
6th December 2004, 03:24 AM
Folks-
I found this that will display the author of the current message:
$post[musername]
and this that will display the number of the parent message:
$post[parentid]
Is there a way to combine them syntactically to give the author of the parent message?
--don
philosophyweb
6th December 2004, 03:46 AM
$post[musername] $post[parentid]
should do it
darnoldy
6th December 2004, 04:41 AM
should do it
Nope... that gives me the poster's name followed by the id number of the parent message, not the name of the poster of the parent message.
--don
philosophyweb
6th December 2004, 05:24 AM
in the bbcode_quote template it recieves the username from the quote=username then you just have to add $post[parentid]
Andrew B.
10th December 2004, 04:39 AM
in the bbcode_quote template it recieves the username from the quote=username then you just have to add $post[parentid]I've been trying to insert the username from the parent message into the legacy postbit on the left. I tried the bbcode quote, different parts of it, and then tried seeing if I could understand and use your suggestion. I get all sorts of things inserted in there, but never the username from the parent message.
Would it be possible for you or someone else to post the full code statement that I could use to insert the username from the parent message into the postbit.
Andrew
HiDeo
10th December 2004, 11:05 AM
$original = $DB_site->query("SELECT postusername FROM " . TABLE_PREFIX . "thread WHERE threadid = $post[parentid]");
Andrew B.
11th December 2004, 03:47 PM
Thanks, HiDeo.
I must be overlooking something. I pasted the line into postbit_legacy, but then it echoed part of the statement into the postbit, instead of displaying a query result. Like this:
= ("SELECT postusername FROM " . TABLE_PREFIX . "thread WHERE threadid = 1287");So I looked for similar statements in the PHP files, to see if I could see a syntax difference. I don't see any.
I should mention that I'm a beginner, and their might be something I don't know about enclosing a a variable statement that queries the database. What I did is simply paste your statement into postbit_legacy on a line after where it says: <!-- / status icon and date -->
Andrew
Andrew B.
11th December 2004, 03:48 PM
Thanks, HiDeo.
I must be overlooking something. I pasted the line into postbit_legacy, but then it echoed part of the statement into the postbit, instead of displaying a query result. Like this:
= ("SELECT postusername FROM " . TABLE_PREFIX . "thread WHERE threadid = 1287");So I looked for similar statements in the PHP files, to see if I could see a syntax difference. I don't see any.
I should mention that I'm a beginner, and there might be something I don't know about enclosing a variable statement that queries the database. What I did is simply paste your statement into postbit_legacy on a line after where it says: <!-- / status icon and date -->
Andrew
Disjunto
11th December 2004, 04:50 PM
add that code to showthread.php or somit :P
darnoldy
11th December 2004, 06:45 PM
HiDeo-
$original = $DB_site->query("SELECT postusername FROM " . TABLE_PREFIX . "thread WHERE threadid = $post[parentid]");
Okay, it looks to me like you're defining the value of a variable $original. I assume that "$original" gets put into the postbit template, but where does one put the line you wrote?
--don
Disjunto
11th December 2004, 06:46 PM
add that code to showthread.php or somit :P
as i said the post before :)
Andrew B.
11th December 2004, 08:16 PM
add that code to showthread.php or somit :PIt might also help if I wasn't a newbie. I've been reading on the web to try to learn PHP, reading here, etc. Trying this and that. So I tried putting this in showthread like this.
<?php
$original = $DB_site->query("SELECT postusername FROM " . TABLE_PREFIX . "thread WHERE threadid = $post[parentid]");
?>And put this in postbit_legacy
<?php
echo $original;
?>I also put both in postbit_legacy to see how that works.
Just not my day to get lucky with this.
Disjunto
11th December 2004, 09:11 PM
edit the file showthread.php :)