since the upgrade to v.0.7.4, ive noticed a problem when sending private messages and with posting in topics/boards
when i click the "preview" button, it dosent show any preview of the pms or posts
and starts to fill up the error log, i think its only a problem for admins
smf/index.php?action=pm;sa=send2
Database Error: Unknown column 'Preview' in 'where clause'
File: smf\Sources\TPortal.php
Line: 111
smf/index.php?action=post2;start=705;board=19
Database Error: Unknown column 'Preview' in 'where clause'
File: smf\Sources\TPortal.php
Line: 122
Lines 111 & 112 Are
if(isset($_REQUEST['preview']) && $context['user']['is_admin']){
$pre_id=$_REQUEST['preview'];
$request = db_query("SELECT * FROM {$tp_prefix}blocks WHERE off=0 OR id=$pre_id ORDER BY bar,pos,id ASC", __FILE__, __LINE__);
}
else
$request = db_query("SELECT * FROM {$tp_prefix}blocks WHERE off=0 ORDER BY bar,pos,id ASC", __FILE__, __LINE__);
... any ideas bloc?
Um, thats serious, it may be conflict of variables on SMF and TP. i will need to look more into it.
k... let me know if theres a quick fix! :)
ive made a small change to that code so the preview will work for pm's and posts,
i removed this bit of code "OR id=$pre_id"
seems to get rid of the error.
Sources\TPortal.php
Find:
if(isset($_REQUEST['preview']) && $context['user']['is_admin']){
$pre_id=$_REQUEST['preview'];
$request = db_query("SELECT * FROM {$tp_prefix}blocks WHERE off=0 OR id=$pre_id ORDER BY bar,pos,id ASC", __FILE__, __LINE__);
}
else
$request = db_query("SELECT * FROM {$tp_prefix}blocks WHERE off=0 ORDER BY bar,pos,id ASC", __FILE__, __LINE__);
Replace With:
if(isset($_REQUEST['preview']) && $context['user']['is_admin']){
$pre_id=$_REQUEST['preview'];
$request = db_query("SELECT * FROM {$tp_prefix}blocks WHERE off=0 ORDER BY bar,pos,id ASC", __FILE__, __LINE__);
}
else
$request = db_query("SELECT * FROM {$tp_prefix}blocks WHERE off=0 ORDER BY bar,pos,id ASC", __FILE__, __LINE__);
That is exactly the failure that i have .....on preview i have a white background.
Thanks to ontap : after removing the little code .....all works fine
Cheers
ReD
I get the same error.
Quote from: ontap on October 06, 2005, 07:19:49 PM
ive made a small change to that code so the preview will work for pm's and posts,
i removed this bit of code "OR id=$pre_id"
seems to get rid of the error.
Sources\TPortal.php
Find:
if(isset($_REQUEST['preview']) && $context['user']['is_admin']){
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, $pre_id=$_REQUEST['preview'];
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, $request = db_query("SELECT * FROM {$tp_prefix}blocks WHERE off=0 OR id=$pre_id ORDER BY bar,pos,id ASC", __FILE__, __LINE__);
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, }
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, else
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, $request = db_query("SELECT * FROM {$tp_prefix}blocks WHERE off=0 ORDER BY bar,pos,id ASC", __FILE__, __LINE__);
Replace With:
if(isset($_REQUEST['preview']) && $context['user']['is_admin']){
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, $pre_id=$_REQUEST['preview'];
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, $request = db_query("SELECT * FROM {$tp_prefix}blocks WHERE off=0 ORDER BY bar,pos,id ASC", __FILE__, __LINE__);
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, }
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, else
ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, Ã‚Ã, $request = db_query("SELECT * FROM {$tp_prefix}blocks WHERE off=0 ORDER BY bar,pos,id ASC", __FILE__, __LINE__);
Are you really sure, that this didn't make any errors in following sessions?
Okay, I test it now.
Quote from: Klozi on October 20, 2005, 09:51:19 PM
I get the same error.
Are you really sure, that this didn't make any errors in following sessions?
nope it dosent, it just removes "OR id=$pre_id"...
after the change the preview errors wont show anymore!
(not to sure what $pre_id is for)
$pre_id is just the ID of the block thats is to be previewd. The trouble is that i used "preview" as a query, whcih also SMF use sometimes..hence the clash and errors. But in the next update this use will be changed.