MyBB Community Forums

Full Version: regex code to call the images into a slide.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to develop this thread into a slide gallery where the picture was taken from a thread that I have previously selected.

and I want to make it less like the attachment below.
[attachment=30430]

I believe this can be done given the MyBB is extraordinary software. because of the limitations of PHP, I do not know what is wrong with the following code. (just copy and paste the following code from a thread that I found.)

please help. please correction.

/***** Slider Gallery Thread Start *****/ 

// Slider Images
 /* LATEST THREADS */
 
$query = $db->query("
       SELECT t.*, p.message
       FROM ".TABLE_PREFIX."threads t
       LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid = t.firstpost)
       WHERE t.fid IN (17,18) AND t.visible='1' AND t.closed NOT LIKE 'moved|%' AND t.firstpost=p.pid
       ORDER BY t.dateline DESC
       LIMIT 1");
 
if(!$db->num_rows($query))
 
    {
        // Needs to output a nice "no posts here" box
        $title = 'Error';
        $message = 'No Message';
       
        eval("\$tricks = \"".$templates->get("member_profile_no_content")."\";");
 
    }
    else
 
    {
    // Set up the parser options.
    $parser_options = array(
        "allow_html" => $forum['allowhtml'],
        "allow_mycode" => $forum['allowmycode'],
        "allow_smilies" => $forum['allowsmilies'],
        "allow_imgcode" => $forum['allowimgcode'],
        "allow_videocode" => $forum['allowvideocode'],
         "filter_badwords" => 1
        );
       
    while($threads = $db->fetch_array($query))
 
        {
        $threads['threadlink'] = get_thread_link($threads['tid']);
 
       
        if($threads['lastposteruid'] == 0)
 
        {
            $lastposterlink = $threads['lastposter'];
 
        }
        else
        {
            $lastposterlink = build_profile_link($threads['lastposter'], $threads['lastposteruid']);
 
        }
        $view_string = 'Views';
        $reply_string = 'Replies';
        if($threads['views'] == 1)
 
        {
            $view_string = 'Views';
 
        }
 
        if($threads['replies'] == 1)
 
        {
            $reply_string = 'Replies';
 
        }
        $threads['profilelink'] = build_profile_link($threads['username'], $threads['uid']);
        $threads['reply'] = $lang->sprintf($lang->thread_views_stats, my_number_format($threads['replies']), $reply_string, my_number_format($threads['views']), $view_string);
        $threads['date'] = my_date($mybb->settings['dateformat'], $threads['dateline']);
        $threads['time'] = my_date($mybb->settings['timeformat'], $threads['dateline']);
        $threads['lastpostlink'] = get_thread_link($threads['tid'], 0, "lastpost");
        $threads['message'] = my_substr($threads['message'], 0, 150) . "...";
        $threads['message'] = $parser->parse_message($threads['message'], $options);
        eval("\$tricks .= \"".$templates->get("depan_slides")."\";");
    }
        }

/***** Slider Gallery Thread End *****/ 

edit.
This is a sample page that I created and I want to show the pictures of the thread that I have previously set.
http://yories.terzier.com/teras.php

anyone who helps will be very important to me. Blush
is there anything that can help? Confused
incredible!. no one answered even though that saw nearly 250 people. Dodgy
is there not willing to help me in this thread? Confused
try asking at all leading MyBB forum but still did not get an answer. [Image: JFBQ00197070418B.gif]

I noticed this is a subcategory help forum Generals, but I did not answer answer. at least, to get a reply. but still not there. [Image: 8dcf9699.gif]
bumping my own threads.

been almost 1 month I asked about this. but until now have not been resolved. asked all seniors but none were able to finish. I know, this is actually easy. but in practice it is seen that difficult.

because of my limitations in the PHP (css / html, etc.) make this a personal project to webforum delayed. just hope the angels of God were willing to help. Sleepy