PDA

View Full Version : Need help with assignment of title/pagetext variables


Burns
07-09-2002, 09:15 PM
Back in 2.2.4 i could successful eliminate
calls of makeinputcode, maketextareacode functions

I replaced
makeinputcode("Thread:","title[$thread[threadid]]",$thread[title]);
with
makelabelcode("Thread:" ,$thread[title]);
and
maketextareacode("Message:","threadpagetext[$thread[threadid]]",$post[pagetext],4,50);
with
$wrapped=dowordwrap($post[pagetext]);
$wrapped=nl2br($wrapped);
makelabelcode("Text:" ,$wrapped); ( thanks FireFly for the help )

It worked with 2.2.5 too.

Now, i found out ( i know i'm a bit slow, still testing the board, it is not live yet ),
if i approve a new thread with changed moderate.php,
the title of the thread is completely missed in forum view
( funny that i can see it in thread view; you can open the thread while it is new and has an icon )
The text of the post is missed as well.

Doesn't makeinputcode("Thread:","title[$thread[threadid]]",$thread[title]);
just assigns the old $thread[title][i] to the [i]$title[$thread[threadid]],
if it was not edited by user ?

I tried $title[$thread[threadid]]=$thread[title]; , but the title is still missed :(
( the same with $threadpagetext[$thread[threadid]]=$post[pagetext]; )

Anyone could give me an advice how to set the right Title and Text variables
without calling edit-boxes and -lines ?

Or at least hide these somehow ?
( i changed the box to 1x1 but even with "minimized" scroll bar in it, it's still annoying... )

I really need it, as moderation will be the place i will spent a lot time in in the future...
i see the ability to edit posts during approvement rather disturbing,
since i would be a bit afraid to change something by accident,
especially while scrolling... with fixed edit window it's also waste of space
regarding small posts and a lot of scrolling with big posts...

Thanks in advance
Burns

Burns
07-10-2002, 01:58 AM
hm...

echo "<input type=\"text\" size=\"1\" name=\"title[$thread[threadid]]\" value=\"$thread[title]\">";

is the shortest form i could make...
Removing this like causes that title of the thread is deleted in the DB

But isn't there any way to avoid the input box,
just assign the value to the variable ?
Just which value...
$title[$thread[threadid]]=$thread[title];
- sure does not works :(

Burns
07-10-2002, 11:56 AM
OK, probably i have the solution:

echo "<input type=\"hidden\" name=\"title[$thread[threadid]]\" value=\"$thread[title]\">";

( could not test it yet )