Error sql with Thread In Portal
#1 10-01-2013 
Lee ehm I have done a mess with this plugin Sad

http://mybbhacks.zingaburga.com/showthread.php?tid=474

Plugin worked but I had all posts in the same place. So, I thought of duplicate the plugin, and replace "xtdispportal" with for example "xtdispportalconcorsi" (in the php page of the plugin).

This worked, I had in a place thread in portal with only samples, and near other column with only contests. Then I added other plugin with other names (xtdispportaltestare ecc Angel ) but the result was an error sql Dodgy and if now I activate plugin, I have this error in homepage and other pages but not in forum Huh:

Code:
MyBB SQL Error
MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1054 - Unknown column 'td.xtdispportal' in 'where clause'
Query:
SELECT t.*, t.username AS tusername, u.username, u.avatar, u.usergroup, u.displaygroup, f.name,
a.updatetime, a.md5hash, a.uploadtime, a.aid, a.attachname, a.filename FROM mybb_threads t LEFT JOIN
mybb_users u ON (u.uid=t.uid) LEFT JOIN mybb_threadfields_data td ON (td.tid=t.tid) LEFT JOIN
mybb_xtattachments a ON (a.tid=t.tid) LEFT JOIN mybb_forums f ON (f.fid=t.fid) WHERE t.visible=1 AND
td.xtdispportal="Yes" AND a.thumbs!="" AND t.closed NOT LIKE "moved|%" GROUP BY t.tid ORDER BY
t.dateline desc

0
#2 10-01-2013 
Is it possible that you do not have the td.xtdisportal custom field enabled for the testare forum?
The site don't jive? PRESS F5 Flower

0
#3 10-01-2013 
I don't know, I deleted all and re-uploaded only original plugin but nothing, there is alwalys error uhm..I'm searching in sql php admin where is this "td.xtdisportal"

0
#4 10-01-2013 
you deleted the threadfield? The custom threadfield in XThreads? In that case it looks for a field that does not exist and therefore errors as you NEED it in the query.
The site don't jive? PRESS F5 Flower

0
#5 11-01-2013 
Yes, I deleted everything (custom fields, templates ecc) Sad
Before of this plugin I think there wasn't td.xtdispportal..why now it is a problem?

0
#6 11-01-2013 
this is what the query says:


Run this query where in the threadfields table there is an entry of xtdispportal=yes
It looks at forum level as well (part of the big query) so if you do not have that field enabled for that forum in custom threadfields it will asplode and if you don't have the field in the database at all it will DEFINITELY asplode.

You can test it by removing the "AND td.xtdispportal=yes" part of the query
The site don't jive? PRESS F5 Flower

0
#7 11-01-2013 
I have this query (from original file):

Code:
$query = $db->query('
        SELECT t.*, t.username AS tusername, u.username, u.avatar, u.usergroup, u.displaygroup, f.name, a.updatetime, a.md5hash, a.uploadtime, a.aid, a.attachname, a.filename
        FROM '.TABLE_PREFIX.'threads t
        LEFT JOIN '.TABLE_PREFIX.'users u ON (u.uid=t.uid)
        LEFT JOIN '.TABLE_PREFIX.'threadfields_data td ON (td.tid=t.tid)
        LEFT JOIN '.TABLE_PREFIX.'xtattachments a ON (a.tid=t.tid)
        LEFT JOIN '.TABLE_PREFIX.'forums f ON (f.fid=t.fid)
        WHERE t.visible=1 AND td.xtdispportal="Yes" AND a.thumbs!="" AND t.closed NOT LIKE "moved|%"'.$xtdispportal_unviewwhere.'
        GROUP BY t.tid
        ORDER BY t.dateline desc
    ');

Now I have active on the site this quey, only changed this:

Code:
WHERE t.visible=1 AND a.thumbs!="" AND t.closed NOT LIKE "moved|%"'.$xtdispportal_unviewwhere.'

but now I have all posts from all forums

0
#8 11-01-2013 
what is in '.$xtdispportal_unviewwhere.'

Meanwhile, try this

Code:
$query = $db->query('
        SELECT t.*, t.username AS tusername, u.username, u.avatar, u.usergroup, u.displaygroup, f.name, a.updatetime, a.md5hash, a.uploadtime, a.aid, a.attachname, a.filename
        FROM '.TABLE_PREFIX.'threads t
        LEFT JOIN '.TABLE_PREFIX.'users u ON (u.uid=t.uid)
        LEFT JOIN '.TABLE_PREFIX.'threadfields_data td ON (td.tid=t.tid)
        LEFT JOIN '.TABLE_PREFIX.'xtattachments a ON (a.tid=t.tid)
        LEFT JOIN '.TABLE_PREFIX.'forums f ON (f.fid=t.fid)
        WHERE t.visible=1 AND td.xtdispportal="Yes"
        GROUP BY t.tid
        ORDER BY t.dateline desc
    ');
The site don't jive? PRESS F5 Flower

0


Sorry, that is a members only option