Activity Stream
48,167 MEMBERS
61164 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 2 of 2
  1.     
    #1
    Member

    Default First post image in the MyBB portal?

    Hello friends,

    Maybe someone can help me...
    I want to show in myBB portal, only the first image in my post, but I don't know how to make that possible.

    I installed this plugin to cut off characters:
    http://mods.mybb.com/view/portal-announcement-cut-off

    But doesn't work like I want, because a URL can have different numbers of characters...
    Unless someone could change the code to appear only the first image inside the [ img ] [ /img] tags.
    Is that possible?

    PHP Code: 
    <?php

    if(!defined("IN_MYBB"))
    {
        die(
    "Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
    }
    $plugins->add_hook("portal_announcement""portalannc");



    function 
    portalannc_info()
    {
        return array(
            
    "name"            => "Portal Announcement Cut Off.",
            
    "description"    => "It sets a minimum of characters for portal announcements.",
            
    "website"        => "http://www.mybb.com/",
            
    "version"        => "1.0",
            
    "author"        => "bubulang",
            
    "authorsite"    => "http://community.mybb.com/user-29135.html",
            
    "compatibility"  => "16*",
            
    'guid'        => 'a18f4b6eed189c9ffd4e4708708c15dc'
        
    );
    }

    function 
    portalannc_activate()
    {
        global 
    $db;
        
        
    $query $db->simple_select("settinggroups""gid""name='portal'");
        
    $gid $db->fetch_field($query"gid");
        
        
    $setting = array(
            
    'name' => 'patcutoff',
            
    'title' => 'Portal Announcement Cut Off',
            
    'description' => 'Set a minimum of characters for portal announcements?',
            
    'optionscode' => 'yesno',
            
    'value' => 'yes',
            
    'disporder' => '20',
            
    'gid' => intval($gid)
        );
        
    $db->insert_query('settings',$setting);
        
        
        
    $characters = array(
            
    'name' => 'characters',
            
    'title' => 'Characters',
            
    'description' => 'Number of characters before the announcement is cut off',
            
    'optionscode' => 'text',
            
    'value' => '',
            
    'disporder' => '21',
            
    'gid' => intval($gid)
        );
        
    $db->insert_query('settings',$characters);
        
        
    $cutoffmessage = array(
            
    'name' => 'cutoffmessage',
            
    'title' => 'Announcement Cut Off Message',
            
    'description' => 'Message to be displayed when announcemet is cut off',
            
    'optionscode' => 'text',
            
    'value' => '..... More',
            
    'disporder' => '22',
            
    'gid' => intval($gid)
        );
        
    $db->insert_query('settings',$cutoffmessage);
        

    rebuild_settings();
    }

    function 
    portalannc_deactivate()
    {
        global 
    $db;

    $db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='patcutoff'");
    $db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='characters'");
    $db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='cutoffmessage'");
        
    rebuild_settings();
    }
        
    function 
    portalannc()    
    {
    global 
    $mybb$announcement;

    if(
    $mybb->settings['patcutoff'] == AND $mybb->settings['characters'] < my_strlen($announcement['message'])){
    $announcement['message'] = my_substr($announcement['message'], 0$mybb->settings['characters']);
    $announcement['message'] .= "[url=".$mybb->settings['bburl']."/".$announcement['threadlink']."]".$mybb->settings['cutoffmessage']."[/url]";
    }
    }

    ?>
    Can someone help me?
    Thank you!
    Divvy Reviewed by Divvy on . First post image in the MyBB portal? Hello friends, Maybe someone can help me... I want to show in myBB portal, only the first image in my post, but I don't know how to make that possible. I installed this plugin to cut off characters: http://mods.mybb.com/view/portal-announcement-cut-off But doesn't work like I want, because a URL can have different numbers of characters... Unless someone could change the code to appear only the first image inside the tags. Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    Solved! Thank you anyway

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Tutorial - How to post an image
    By DeLeTeD in forum Tutorials and Guides
    Replies: 28
    Last Post: 26th May 2012, 08:21 AM
  2. How can I block file & image host on my mybb forum??
    By DJboutit in forum Webmaster Discussion
    Replies: 2
    Last Post: 17th May 2012, 08:05 PM
  3. Image limit per post should be increased
    By Z_UpLoAdEr in forum Feedback and Suggestions
    Replies: 9
    Last Post: 20th Nov 2011, 07:21 AM
  4. What is your favourite drink (post Image only)
    By Bright in forum General Discussion
    Replies: 50
    Last Post: 22nd Jan 2011, 06:28 AM
  5. Wordpress Post Image Help
    By _brazzO in forum Webmaster Discussion
    Replies: 5
    Last Post: 8th Oct 2010, 11:47 AM

Tags for this Thread

BE SOCIAL