• Rejestracja
vBHELP.pl - polskie wsparcie vBulletin
  1. #1
    Awatar falon
    falon jest nieaktywny Advanced Member
    Dołączył
    Jul 2008
    Posty
    911
    Przydatne posty
    3

    Domyślnie Przeróbka zakładek dla vbadvanced

    Zwracam się z prośbą o przerobienie treści z pliku odpowiedzialnego za wyświetlanie treści dla danej zakładki z tej modyfikacji dla vbadvanced: http://www.vbadvanced.com/forum/showthread.php?t=31617

    Obecnie po zainstalowaniu zakładki wyglądają tak:


    A chciałbym żeby było podobnie jak tutaj:


    Czyli wyświetlana belka z tytułem zakładki (Na obrazku: Najnowsze tematy z Hands...)
    I wyświetlanie tylko tytułów wątków bez innych danych, nawet nie musi być na końcu watku nazwy usera.

    Może być także tak jak jest u mnie ale żeby nie było pod tytułem watku takich detali jak Nazwa Usera, data, godzina, w tabeli last post tylko data i godzina bez np. by Jabol.
    A nad czerwoną belką z Title, Username, Date; Last Post itd belka z nazwą zakładki.

    Ma to na celu odchudzenie treści żeby kazdy wyświetlany watek nie był taki wysoki bo zajmuje za dużo miejsca.

    Poniżej treść pliku odpowiedzialna za wyświetlanie watków zakładki próbnej:

    Kod php:
    <?php
    // ####################### SET PHP ENVIRONMENT ###########################

    error_reporting(E_ALL & ~E_NOTICE);

    // #################### DEFINE IMPORTANT CONSTANTS #######################

    define('NO_REGISTER_GLOBALS'1);
    define('THIS_SCRIPT''tabsample1'); // change this to the filename

    // ################### PRE-CACHE TEMPLATES AND DATA ######################

    // get special phrase groups
    $phrasegroups = array();

    // get special data templates from the datastore
    $specialtemplates = array('iconcache');

    // pre-cache templates used by all actions
    $globaltemplates = array();

    // pre-cache templates used by specific actions
    $actiontemplates = array();

    // ######################### REQUIRE BACK-END ############################

    require_once('./global.php');
    require_once(
    './includes/vba_cmps_global.php');
    require_once(
    './includes/functions_forumdisplay.php');

    // ############# MODIFICATION CONTROL OPTIONS ############################

    $mod_options['portal_threads_forumid'] = '21,43,44';     // Add the forumid(s) you would like to display threads from in your news module. Seperate each with a comma.
    $mod_options['portal_threads_maxthreads'] = '10';    // Set this for the Max Number of Threads to Display.
    $mod_options['portal_threads_maxchars'] = '30';      // Set This for the Max Number of Characters you want to Display for the Thread Title.
    $mod_options['portal_threads_cutoffdate'] = '360';   // Enter a number of days that represents a threshold for recent threads. 
    $mod_options['portal_threads_orderby'] = ''// thread.dateline
    $mod_options['portal_threads_orderby'] = 'lastpost'// if you want Ramdom replace with: RAND() 
    $mod_options['portal_threads_direction'] = 'DESC';   // 
    $mod_options['portal_threads_showicon'] = '0';       // 1=ON 0=OFF

    // ## DO NOT EDIT BELOW THIS POINT UNLESS YOU KNOW EXACTLY WHAT YOU ARE DOING ##

    // #######################################################################
    // ######################## START MAIN SCRIPT ############################
    // #######################################################################

    $show['lastpost'] = $mod_options['portal_threads_lastpost'];
    $markinglimit = (TIMENOW - ($vbulletin->options['markinglimit'] * 86400));
    $forumids = array($mod_options['portal_threads_forumid']);

    // Set the last visit date to the marking limit so new threads will not be based on individual cookie
        
    if ($pages['name'] == 'home' AND !$vbulletin->userinfo['userid'] AND $vba_options['portal_guestcache'])
        {
            
    $vbulletin->userinfo['lastvisit'] = $markinglimit;
        }

    // Database read marking
        
    if ($vbulletin->options['threadmarking'] AND $vbulletin->userinfo['userid'])
        {
            
    $rthread_fields .= ', threadread.readtime AS threadread, forumread.readtime AS forumread';
            
    $rthread_join .= ' LEFT JOIN ' TABLE_PREFIX 'threadread AS threadread ON (threadread.threadid = thread.threadid AND threadread.userid = ' $vbulletin->userinfo['userid'] . ')  LEFT JOIN ' TABLE_PREFIX 'forumread AS forumread ON (thread.forumid = forumread.forumid AND forumread.userid = ' $vbulletin->userinfo['userid'] . ')';
        }



    // MAIN SQL

    $threads $db->query_read("
        SELECT 
    $rtrating_fields thread.threadid, thread.title, thread.replycount, postusername, postuserid, thread.dateline AS postdateline, IF(views <= thread.replycount, thread.replycount+1, views) AS views, thread.lastposter, thread.lastpost, thread.lastpostid, pollid, thread.forumid, thread.open, sticky, post.pagetext AS preview, thread.iconid AS threadiconid, iconpath AS threadiconpath $rthread_fields
                            
        FROM " 
    TABLE_PREFIX "thread as thread
        
            LEFT JOIN " 
    TABLE_PREFIX "post AS post ON (post.postid = thread.firstpostid)
            LEFT JOIN " 
    TABLE_PREFIX "icon AS icon ON (icon.iconid = thread.iconid)
            
    $rthread_join
        
        WHERE open != 10
        
        AND thread.visible = 1 " 
    .
            
    iif($mod_options['portal_threads_cutoffdate'], 'AND thread.lastpost > ' . (TIMENOW $mod_options['portal_threads_cutoffdate'] * 86400)) .
            
    iif($ignusers' AND thread.postuserid NOT IN(' $ignusers ')') . "
                                    
        AND thread.forumid IN(" 
    implode(','$forumids) . ")
                            
        ORDER BY 
    $mod_options[portal_threads_orderby] $mod_options[portal_threads_direction]
            
        LIMIT 
    $mod_options[portal_threads_maxthreads]
        "
    );
              
    $mods['threadcount'] = $db->num_rows($threads);
                   

    // CONTENT HEADER OUTPUT (echos out Table Header into Tab Div Container)

    echo '<table border="0" cellpadding="6" cellspacing="1" class="tborder" width=100%>
            <tr> 
                <td class="thead" width="2%">&nbsp;</td> 
                <td class="thead" width="50%">Title, Username, Date</td>
                <td class="thead" width="25%" align="center" style="white-space: nowrap" >Last Post</td>
                <td class="thead" width="2%">Replies</td>
                <td class="thead" width="2%" align="center">Views</td>
            </tr>'
    ;

    // CONTENT LOOP (Loops through each result set created by the MAIN SQL)


        
    while ($thread $db->fetch_array($threads))
        {
            
    $bgclass exec_switch_bg();
                           
            
    // The vB preview function can be intensive w/ long strings, so let's try to save some overhead
            
    $thread['preview'] = substr($thread['preview'], 0, ($vbulletin->options['threadpreview'] * 10));
                            

            
    // Trim title
            
    if (strlen($thread['title']) > $mod_options['portal_threads_maxchars'] AND $mod_options['portal_threads_maxchars'])
                {
                    
    $thread['title'] = fetch_trimmed_title($thread['title'], $mod_options['portal_threads_maxchars']);
                }

            
    // Check for long words that may stretch the page
            
    if ($mod_options['portal_threads_maxwordchars'])
                {
                    
    $thread['titlecheck'] = explode(' '$thread['title']);

                        if (!empty(
    $thread['titlecheck']))
                            {
                                
    $thread['title'] = '';

                                    foreach (
    $thread['titlecheck'] AS $key => $word)
                                        {
                                             if (!
    $thread['titletrimmed'])
                                                {
                                                     if (
    strlen($word) > $mod_options['portal_threads_maxwordchars'])
                                                        {
                                                            
    $word fetch_trimmed_title($word$mod_options['portal_threads_maxwordchars']);
                                                            
    $thread['titletrimmed'] = true;
                                                        }

                                                    if (
    $thread['title'])
                                                        {
                                                            
    $thread['title'] .= ' ';
                                                        }

                                                    
    $thread['title'] .= $word;
                                                }
                                         }
                            }
                }

                
    // Thread read marking
                
    if ($vbulletin->options['threadmarking'] AND $vbulletin->userinfo['userid'])
                {
                    if (
    $thread['threadread'] < $thread['forumread'])
                    {
                        
    $thread['threadread'] = $thread['forumread'];
                    }
                }
                
    // Check the cookie, but only if guest caching is not enabled
                
    else if (!$vb_read_cookies[$thread['forumid']])
                {
                    if (
    $vbulletin->userinfo['userid'] OR !$vba_options['portal_guestcache'] OR $pages['name'] != 'home')
                    {
                        
    $vb_read_cookies[$thread['forumid']] = max(fetch_bbarray_cookie('forum_view'$thread['forumid']), $markinglimit);
                    }
                    else
                    {
                        
    $vb_read_cookies[$thread['forumid']] = $markinglimit;
                    }
                }

                if (!
    $thread['threadread'] AND ($vb_read_cookies[$thread['forumid']] >= $thread['lastpost'] OR $markinglimit $thread['lastpost']))
                {
                    
    $thread['threadread'] = TIMENOW;
                }
                else if (!
    $vbulletin->options['threadmarking'])
                {
                    
    $thread['threadread'] = '-1';
                }

                
    $thread process_thread_array(
                    
    $thread,
                    
    $thread['threadread'],
                    
    $mod_options['portal_threads_showicon']
                );



    // CONTENT OUTPUT (echos out each individual recent thread result into Tab Div Container)  

            
            
    echo '<tr>'
            
            if (!
    $thread[threadiconpath])
            {
                echo 
    '<td class="alt2">&nbsp;</td>';
            }
            else
            {
                echo 
    '<td class="alt2"><img alt="" border="0" src="' $thread[threadiconpath] . '" title="' $thread[threadicontitle] . '" /></td>';
            }    
            
            echo 
    '<td class="alt1" class="smallfont" width="50%">';
            
            if (
    $show[gotonewpost])
            { 
                echo 
    '<a href="showthread.php?t=' $thread[threadid] . '"title="' $thread[preview] . '"><strong>' $thread[title] . '</strong></a>';
            }
            else
            {
                echo 
    '<a href="showthread.php?t=' $thread[threadid] . '"title="' $thread[preview] . '"><i>' $thread[title] . '</i></a>';
            }

            echo 
    '<br />' .  $thread['postusername'] . '<br /><div class="smallfont">' $thread[postdate] . '&nbsp;<span class="time">' $thread[posttime] . '</span></div></td>';
            echo 
    '<td class="alt2" width="20%"><div class="smallfont" style="text-align:right; white-space:nowrap">' $thread[lastpostdate] . '&nbsp; <span class="time">' $thread[lastposttime] . ' </span> <br />by <a href="member.php?find=lastposter&amp;t=' $thread[threadid] . '">' .  $thread[lastposter] . '</a>&nbsp;<a href="showthread.php?p=' $thread[lastpostid] . '#post' $thread[lastpostid] . '"><img border="0" src="images/buttons/lastpost.gif" title="Go To Last Post" /></a></div></td>';
            echo 
    '<td align="center" class="alt1" width="2%"> <span class="smallfont">' $thread[replycount] . ' </span></td>';
            echo 
    '<td align="center" class="alt2" width="2%"> <span class="smallfont">' $thread[views] . '</span></td>';
            echo 
    '</tr>';
                

        }

    $db->free_result($threads);
    unset(
    $thread);


    echo 
    '</table>';

    ?>
    Ostatnio edytowane przez falon ; 01.03.2009 o 12:11



  2. #2
    Awatar falon
    falon jest nieaktywny Advanced Member
    Dołączył
    Jul 2008
    Posty
    911
    Przydatne posty
    3

    Domyślnie

    Pozwole sobie podbic.
    30zł za przerobienie.


  3. #3
    cizu jest nieaktywny Advanced Member
    Dołączył
    Aug 2008
    Posty
    454

    Domyślnie

    Ale przecież Ty masz konkretne subfora podpięte pod zakładki to jak chcesz mieć wyświetlane np: 10 ostatnich tematów :>?
    Ogółem zarzuć mi linkami do Tych przykładów na pm


  4. #4
    Awatar falon
    falon jest nieaktywny Advanced Member
    Dołączył
    Jul 2008
    Posty
    911
    Przydatne posty
    3

    Domyślnie

    Cizu. Przeczytaj dokładnie co ja chcę. Ja umiem poustawiac bo to się robi w tym pliku którego treść podałem. Ja potrzebuję zmienić treść tego pliku tak żeby wyświetlało tak ja na przykładzie. Przyjrzyj się i doczytaj.


Podobne wątki

  1. Dodanie zakładki w navbarze + podrzędnej zakładki.
    By DevilaN in forum Pytania i problemy
    Odpowiedzi: 1
    Ostatni post / autor: 17.12.2010, 18:42
  2. Odpowiedzi: 0
    Ostatni post / autor: 04.07.2010, 10:27
  3. Odpowiedzi: 0
    Ostatni post / autor: 04.07.2010, 06:15
  4. vBadvanced
    By day-dreamer in forum Pytania i problemy
    Odpowiedzi: 3
    Ostatni post / autor: 16.03.2009, 20:49
  5. vBAdvanced CPMS
    By Olun in forum Pytania i problemy
    Odpowiedzi: 1
    Ostatni post / autor: 11.11.2008, 17:38
Chmurka.pl

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