how to write this code?
terzier Offline
Member
***
Posts: 91
Joined: Feb 2012
Post: #1
Sad how to write this code?
terzier Wrote:I do not know what the title should give this thread. and I also do not know what else to ask anyone else. hopefully I can get a solution here. Ouch

I want to develop a slide based on the thread Johnny S.

of the thread, I want to do is on each slide (Slide Nivo) The images files (certainly with images ([*img - [/img*]). with extensions jpg; jpeg; png; gif) taken from the forums that have been set previously.

a friend told to use the "Regex". however, conflating PHP with RegEx really makes me confused. Out

The following code is just copy-paste that I get from some communities. I know, that there are shortcomings and errors of this code. I ask that anyone willing to correct the code to be run like that I mean.  Whip

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
***** 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 *****/ 


terzier Wrote:I have made a similar thread in various forums such as this but of everything that did not get a solution. hope there are experts who are willing to help.
Yipi

sorry if my english poor Ouch

Un-Official MyBB from Indonesia| Facebook Page|Twitter
GARUDA DIDADA KU
11-08-2013 04:11 PM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
how to write this code? - terzier - 11-08-2013 04:11 PM
RE: how to write this code? - terzier - 11-10-2013, 02:41 PM
RE: how to write this code? - ZiNgA BuRgA - 11-10-2013, 05:22 PM
RE: how to write this code? - terzier - 11-13-2013, 01:24 AM
RE: how to write this code? - terzier - 11-14-2013, 07:43 PM
RE: how to write this code? - terzier - 11-17-2013, 05:39 PM
RE: how to write this code? - ZiNgA BuRgA - 11-22-2013, 04:36 PM
RE: how to write this code? - terzier - 11-23-2013, 01:22 AM

 Standard Tools
Forum Jump: