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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 195,994
  • Total Topics: 21,325
  • Online today: 142
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 69
  • Total: 69

Preview Problem...

Started by ontap, October 05, 2005, 07:28:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ontap

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?

bloc

Um, thats serious, it may be conflict of variables on SMF and TP. i will need to look more into it.

ontap

k... let me know if theres a quick fix! :)

ontap

#3
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__);

redshark

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

Klozi

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.

ontap

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)

bloc

$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.

This website is proudly hosted on Crocweb Cloud Website Hosting.