xthreads error
1master1 Offline
Member
***
Posts: 232
Joined: Oct 2010
Post: #21
RE: xthreads error
bad news. Frown i tried setting the live board copy on my localhost, but it didnt allowed and gave errors as most of the plugins settings are enabled by default.
01-15-2011 06:10 PM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #22
RE: xthreads error
I think you need to download all plugin files from your live board, and copy it to your board copy (test forum).

01-16-2011 02:15 AM
Find all posts by this user Quote this message in a reply
1master1 Offline
Member
***
Posts: 232
Joined: Oct 2010
Post: #23
RE: xthreads error
yep, i had done it. got the error when making the live board's database copy restore on localhost. mybbpublisher is activated on live forum and its errors are more when trying the restore on localhost
(This post was last modified: 01-16-2011 03:56 AM by 1master1.)
01-16-2011 03:56 AM
Find all posts by this user Quote this message in a reply
1master1 Offline
Member
***
Posts: 232
Joined: Oct 2010
Post: #24
RE: xthreads error
this is the code causing the error from xt_forumdhooks.php


Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function xthreads_forumdisplay_dbhook(&$s, &$db) {
            global $threadfield_cache, $fid, $plugins, $threadfields;
            //if(empty($threadfield_cache)) return;
            
            $fields = '';
            foreach($threadfield_cache as &$v)
                $fields .= ', tfd.`'.$v['field'].'` AS `xthreads_'.$v['field'].'`';
            
            $s = strtr($s, array(
                'SELECT t.*, ' => 'SELECT t.*'.$fields.', ',
                'WHERE t.fid=' => 'LEFT JOIN `'.$db->table_prefix.'threadfields_data` tfd ON t.tid=tfd.tid WHERE t.fid=',
            ));
            $plugins->add_hook('forumdisplay_thread', 'xthreads_forumdisplay_thread');
            $threadfields = array();
        }

02-16-2011 09:10 PM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #25
RE: xthreads error
Upload your forumdisplay.php here.

02-17-2011 01:54 AM
Find all posts by this user Quote this message in a reply
1master1 Offline
Member
***
Posts: 232
Joined: Oct 2010
Post: #26
RE: xthreads error
Here it is rateu, http://pastebin.com/wCk6xh3W

As suggested some other mybb techie, i changed the tfd to t in the xt_forumdhooks.php. But it also gave the same error.
02-17-2011 04:35 PM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #27
RE: xthreads error
Do you have a plugin that pull out forum announcement and can be viewed in forumdisplay?

02-18-2011 03:26 AM
Find all posts by this user Quote this message in a reply
1master1 Offline
Member
***
Posts: 232
Joined: Oct 2010
Post: #28
RE: xthreads error
proportal and clear news bar.
clear news bar do display the threads from selected forums on forum display.
and proportal displays in separate portal templates
RateU, I <3 you man. You are my hero Tongue

Yeah, that news bar plugin is the cause. I just deactivated it and the problem solved. Well, here is the clear news bar plugin code. Can you please rectify the error in the below news bar code so that it will not reproduce that error? I wanna use this plugin though.

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?php

/*
A clear news bar plugin for MyBB

* v. 1.0
* Last edit: 5 August 2010
* Shows a clear news bar on your forum pages.
* Copyright (C) 2009 & 2010 Mateusz Grzesiukiewicz also known as Ajdija 
* Website: http://www.ajdija.com

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

if(!defined('IN_MYBB'))
{
    die();
}

$plugins->add_hook('pre_output_page','aclearnewsbar');

function aclearnewsbar_info()
{
    return array
    (
        "name"=>"A clear news bar",
        "description"=>"Shows a clear bar with latest news from your portal page.",
        "website"=>"http://www.ajdija.com",
        "author"=>"Mateusz Grzesiukiewicz",
        "authorsite"=> "http://www.ajdija.com",
        "version"=>"1.0",
        "guid"=>"7dc27e3041bfe6e412f1a9b2f7634db2",
        "compatibility"=>"16*"
    );
}

function aclearnewsbar($page)
{
    global $mybb,$theme, $db;
        if(THIS_SCRIPT!='portal.php') // do not show news bar on portal(news) page
        {
        $announcementsfids = explode(',', $mybb->settings['portal_announcementsfid']);
if(is_array($announcementsfids))
{
    foreach($announcementsfids as $fid)
    {
        $fid_array[] = intval($fid);
    }
    $announcementsfids = implode(',', $fid_array);
}
$query = $db->simple_select("forums", "*", "fid IN (".$announcementsfids.")");
while($forumrow = $db->fetch_array($query))
{
    $forum[$forumrow['fid']] = $forumrow;
}

$pids = '';
$tids = '';
$comma = '';
$query = $db->query("
    SELECT p.pid, p.message, p.tid
    FROM ".TABLE_PREFIX."posts p
    LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
    WHERE t.fid IN (".$announcementsfids.") AND t.visible='1' AND t.closed NOT LIKE 'moved|%' AND t.firstpost=p.pid
    ORDER BY t.dateline DESC 
    LIMIT 0, ".$mybb->settings['portal_numannouncements']
);
while($getid = $db->fetch_array($query))
{
    $pids .= ",'{$getid['pid']}'";
    $tids .= ",'{$getid['tid']}'";
    $posts[$getid['tid']] = $getid;
}
$pids = "pid IN(0{$pids})";
$query = $db->simple_select("attachments", "*", $pids);
while($attachment = $db->fetch_array($query))
{
    $attachcache[$attachment['pid']][$attachment['aid']] = $attachment;
}

if(is_array($forum))
{
    foreach($forum as $fid => $forumrow)
    {
        $forumpermissions[$fid] = forum_permissions($fid);
    }
}

$announcements = '';
$query = $db->query("
    SELECT t.*, t.username AS threadusername, u.username, u.avatar
    FROM ".TABLE_PREFIX."threads t
    LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
    WHERE t.fid IN (".$announcementsfids.") AND t.tid IN (0{$tids}) AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
    ORDER BY t.dateline DESC
    LIMIT 0, ".$mybb->settings['portal_numannouncements']
);

$news = '--- ';
while($announcement = $db->fetch_array($query))
{
    $announcement['threadlink'] = get_thread_link($announcement['tid']);
    $announcement['subject'] = htmlspecialchars_uni($announcement['subject']);
    $news = $news.'<a href="'.htmlspecialchars_uni($announcement['threadlink']).'">'.htmlspecialchars_uni(        $announcement['subject']).'</a> --- ';
}
        
            $page=preg_replace('#<div class="navigation">(.*)</div>#Usi','<table border="0" cellspacing="'.$theme["borderwidth"].'" cellpadding="'.$theme["tablespace"].'" class="newsborder">
    <thead>
        <tr> 
            <td class="newshead" width="100px">Latest '.
            /* Use below code and set ^^(width) higher if you want board name to be said:
            $mybb->settings['bbname'] 
            */
            'News: </td><td class="newhead"><div class="horizontal_scroller" style="font-weight: bold;"><div class="scrollingtext">'.$news.'</div></div></td>
        </tr>
    </thead>
</table><br /><div class="navigation">$1</div>',$page);
        return $page;
        }
    }

?>

(This post was last modified: 02-18-2011 05:14 AM by 1master1.)
02-18-2011 05:02 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #29
RE: xthreads error
Try to edit line (line #102), replace it with:

PHP Code:
102
    SELECT u.username, u.avatar, t.*, t.username AS threadusername


02-18-2011 05:40 AM
Find all posts by this user Quote this message in a reply
1master1 Offline
Member
***
Posts: 232
Joined: Oct 2010
Post: #30
RE: xthreads error
Thank you very much RateU. <3
02-18-2011 05:41 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: