Thread Rating:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Using XThreads Custom Thread Fields For Plugin Settings
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #31
RE: Using XThreads Custom Thread Fields For Plugin Settings
I'm not sure if this is the fault of ProPortal, but with MyBB modifications, mysql_query really should never be called (as it is in the above attached PHP file).  Will most likely error if MyBB is using MySQLi for example.

My Blog
06-19-2011 10:38 PM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #32
RE: Using XThreads Custom Thread Fields For Plugin Settings
I will check that out Zinga - I THINK its in all the pro_portal blocks, but I will do some testing.

Thanks for pointing this out Smile
Ok, I had a look at the file and yes, it will also work with the more usual (and correct)

Code:
$query = $db->query(" 
		SELECT select stuff here
");
		while($stuff = $db->fetch_array($query)){
etc etc


New file attached.



Attached File(s)
.zip  block_xtportal_displayv2.zip (Size: 1.66 KB / Downloads: 479)


[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 06-19-2011 10:55 PM by leefish.)
06-19-2011 10:45 PM
Visit this user's website Find all posts by this user Quote this message in a reply
av8r_bra Offline
Junior Member
**
Posts: 11
Joined: Jun 2011
Post: #33
RE: Using XThreads Custom Thread Fields For Plugin Settings
Thanks leefish, worked like a charm!

Kinda offtopic but, do you know a way to exclude a forum id from showing up on latest threads block? This way the same posts won't be showing twice in my portal Smile

Again, awesome job by xthreads and its community..turned mybb into a sandbox bb..tyvm!!
06-20-2011 05:16 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #34
RE: Using XThreads Custom Thread Fields For Plugin Settings
Ok, sorry about that mistake. I have edited the latestthreads block for you, but I am not as good and secure a coder as ZingaBurga or RateU, so I am not 100% sure it is secure.

basically, I have added a variable called $excluded and in there you can put the forums you want to have excluded from the block. There may well be a smarter way to do it, but I don't know it.

You need to open the block in your php editor (notepad++ is what I use) and put which forums you want to have excluded

Its this line

Code:
	$excluded = "AND fid NOT IN ('2')";


If you wanted to exclude forums 3 and 7 then you replace/edit that line as in the line below:

Code:
	$excluded = "AND fid NOT IN ('3','7')";


The attached file is a replacement for the proportal latest threads block. You might want to put the original somewhere safe.



Attached File(s)
.zip  block_latestthreads.zip (Size: 1.54 KB / Downloads: 510)


[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 06-20-2011 06:55 AM by leefish.)
06-20-2011 06:53 AM
Visit this user's website Find all posts by this user Quote this message in a reply
av8r_bra Offline
Junior Member
**
Posts: 11
Joined: Jun 2011
Post: #35
RE: Using XThreads Custom Thread Fields For Plugin Settings
Thanks again lee, will change my latestthreads block Smile

Btw, I've found that my portal page only works when I'm logged as a user, if not logged in I get an error loading the page:

Erro de SQL:
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '66','61','66','58','62','61').' ORDER BY t.dateline desc LIMIT 5' at line 6
Consulta:
SELECT t.*, t.username AS tusername, u.username, u.avatar, u.usergroup, u.displaygroup, f.name 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_forums f ON (f.fid=t.fid) WHERE t.visible=1 AND td.xtdispportal='Yes' AND t.closed NOT LIKE 'moved|%''. AND t.fid NOT IN ('66','61','66','58','62','61').' ORDER BY t.dateline desc LIMIT 5

Removing custom thread block solves the problem, I've double checked and everything seems to be ok =/
06-20-2011 11:42 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #36
RE: Using XThreads Custom Thread Fields For Plugin Settings
As you can see it is fine for me on my board as a guest - and the mysql error should be solved. I think you need to check that the block is enabled for guests and that you have guests allowed to view the forums. Other than that I can take a look on your site for you if you wish to give me admin access.

I dont think it will make a big difference, but you have forum 66 and 61 specified twice in that list.


[Image: leelink.gif]
MYBB1.6 & XThreads
06-20-2011 01:07 PM
Visit this user's website Find all posts by this user Quote this message in a reply
av8r_bra Offline
Junior Member
**
Posts: 11
Joined: Jun 2011
Post: #37
RE: Using XThreads Custom Thread Fields For Plugin Settings
Hey lee, sent you a PM Smile
06-21-2011 04:56 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #38
RE: Using XThreads Custom Thread Fields For Plugin Settings
Updated (trying to "integrate" it more with XThreads):
  • Trying to use some hooks provided by XThreads to automatically deactivate our XThreads related plugins if user deactivates/uninstalls XThreads (maybe it is better if our XThreads related plugins use install-uninstall function).
  • Trying to prevent user to be able to activate our XThreads related plugins if XThreads isn't installed or activated, or some XThreads functions to be used for our plugins isn't available (depends on which XThreads functions we'll use for our plugins).
  • Trying to use a XThreads function to "detects" in which forum id(s) our custom thread fields applied by user (in this example, xtdispportal), and use the forum id(s) in our query (if user selects some forum(s) only), and trying to run our codes, only if the specific custom thread fields already available/created (trying to prevent SQL error if user deletes the custom thread fields later).
Please tell me if there is something wrong with the codes. I'm still learning Biggrin

10-18-2011 05:54 AM
Find all posts by this user Quote this message in a reply
nier3 Offline
Member
***
Posts: 125
Joined: Jul 2012
Post: #39
RE: Using XThreads Custom Thread Fields For Plugin Settings
Hi, I would like to ask a help with this plugin.

I have installed it and it works (there are titles, posted in:, replies: preview etc) but I would like to add also an image.

- I have added {$xtdispportal_threads} in a portal page outside of forum (place where show result: title post and image);
- Created new Custom Thread Fields for image files, with Image Thumbnail Generation 100x100;
- In xtdispportal_threads_thread template added:

Code:
<a href="{$mybb->settings['bburl']}/{$xtdispportal_thread_link}"><img src="{$GLOBALS['threadfields']['test']['url']}/thumb100x100" width="{$GLOBALS['threadfields']['test']['thumbs']['100x100']['w']}" height="{$GLOBALS['threadfields']['test']['thumbs']['100x100']['h']}"  alt=" " /></a>


But it doesn't work..where I wrong?

01-08-2013 09:08 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #40
RE: Using XThreads Custom Thread Fields For Plugin Settings
(01-08-2013 09:08 AM)nier3 Wrote:  But it doesn't work..where I wrong?

Unfortunately, it is not designed for displaying images.

01-14-2013 01:34 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: