Query to get threads ?
FBI Offline
Junior Member
**
Posts: 19
Joined: Apr 2010
Post: #11
RE: Query to get threads ?
$thread-trend to get Subject (limited by 55 chars)
and this subject together work with another template call (portal_latest_trend) like this

Code:
<div>
<a href="{$mybb->settings['bburl']}/thread-{$thread-trend['tid']}.html">{$thread-trend['subject']}</a>
</div>


So I have full thread link to display on my custom page.
But, as you said there is no Join.
Could you please help, which code should be add? Smile


Brand New Portal from MyBB Indonesia  to get local Bahasa (language) support.
My Unique Plugin here Smile
08-22-2010 06:19 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #12
RE: Query to get threads ?
???
A '-' character is either a subtraction operator, or a negation.  You cannot include them in variable names.  Did you mean the underscore (_) character instead.

"$thread-trend[...]" is an invalid PHP expression.  It means "get the $thread variable, and subtract trend[...] from it.  But trend isn't prefixed with a $, so it can't be a variable, it must be a fixed (constant) expression.  But constants can't be arrays, therefore, it's invalid syntax"
With the above expression, you should get something like:

Code:
Parse error: syntax error, unexpected '[', expecting ',' or ';' in ... on line ...



Adapt the following to your needs.

PHP Code:
$query = $db->query(' SELECT t.subject, p.prefix from '.TABLE_PREFIX.'threads t LEFT JOIN '.TABLE_PREFIX.'threadprefixes p ON t.prefix=p.pid ...');


My Blog
(This post was last modified: 08-22-2010 09:54 PM by ZiNgA BuRgA.)
08-22-2010 09:54 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: