Administrator
3wProducer
Imagination is more Important than Knowledge
08.05.2017 21:24:16
United States
|
 |
Link: http://poligon.ricoroco.com/fora/smf/index.php?topic=331.msg1208#msg1208
Post #9 |
|
Witam!  Pojawię się na poważniej dopiero po grobkach, okay? Dzięki Draco za przejaśnienie. Ciężko było sqmać co miał na myśli Tomeh. Ja to rozumiem tak: - Jest tabela z grubsza podzielona na dwie części (lewa i prawa) To tu w zamyśle Tomka było zamienić je miejscami. - Prawa część tabeli, (która ma być po lewej), składa się z 3 komórek: 1 - ostatni Topik 2 - Autor 3 - Data To tu komórka Nr.2 (czyli Autor) --> wylatuje i zostaje tylko 1 i 3 - Lewa strona tabeli, (która ma docelowo być po prawej) ma zawierać tylko TOP 10 tematów pod względem oglądalności i docelowo ma mieć tylko 2 komórki czyli: 1 - Topik (o największej oglądalności) 2 - Autor --> do wycięcia 3 - Ilość wyświetleń Czyli reasumując kształt ostateczny ma być taki Ostatnie wiadomości | Top 10 Topics (by Views) |
Wiadomość | Data | Temat | Wyświetleń |
Zresztą tak to zrobiłem (fota w załączniku) Dodatkowo - poprawiłem wyświetlanie, czyli odstępy wielkość fonta, grafiki, i w lewej części jest wydłużona nazwa, natomiast tam gdzie te TOP 10 to już gościu zakombinował i dał skacacz ilości znaków do 18. Żeby to zmienić, np. ustawić tę liczbę na 50 znaków, (to w zupełności wystarczy..), to już należy wy-edytować plik z silnika SMF, tj. z katalogu Sources, plik - BoardIndex.php Trzeba znaleźć w tym pliku wpisy od moda czyli to miejsce: // TopStats by www.gorselsanatlar.orgI długo poniżej będzie wpis: // Topic views top 10. $topic_view_result = db_query("
// Created by GeSHi 1.0.8.10 | code: -› [code=PHP] | load:0.022s | speed:2.68 KB/s I w tym wywołaniu do bazy, parę wierszy po niżej znajduje się ten ogranicznik: censorText($row_topic_views['subject']); $row_topic_views['subject'] = shorten_subject($row_topic_views['subject'], 18);
// Created by GeSHi 1.0.8.10 | code: -› [code=PHP] | load:0.022s | speed:6.66 KB/s Widzisz na końcu liczbę 18? to tylko i wyłącznie zmień tę liczbę na 50 censorText($row_topic_views['subject']); $row_topic_views['subject'] = shorten_subject($row_topic_views['subject'], 50);
// Created by GeSHi 1.0.8.10 | code: -› [code=PHP] | load:0.024s | speed:6.27 KB/s Wtedy będziesz miał w TOP 10 dłuższą nazwę topiku. Okay teraz i o ile dobrze Cię zrozumiałem z tą tabela i tym co ma w niej być, to pokażę Ci który kawałek kodu zamienisz na podobny ode mnie i będzie ten efekt. Jednak zanim przejdę do rzeczy, to proponuję zadaj sobie trud i po adresie twojego forum/ dopisz - ssi_examples.php czyli: forum_tomka.pl/ssi_examples.php i dostaniesz listę funkcji SSI i zobaczysz sam, że gościu notabene Turek, bez urazy.. troszkę to ponaciągał.., a przy najmniej w twoim wypadku.. Mam niemal to samo tutaj na HOME - wykorzystuję funkcje SSI. Zobacz i się zastanów nad sensem tego moda, skoro można tak wiele info wyciągnąć za pomocą SSI. Wyciągnij wnioski... A teraz do rzeczy: W stylu default, w pliku BoardIndex.template.php znajdź wpisy od tego moda, - a dokładnie od tego miejsca (u mnie to około ~ 282 linii): //top stats start. by [url=http://www.gorselsanatlar.org]www.gorselsanatlar.org[/url] // --> od powyższego miejsca
// Created by GeSHi 1.0.8.10 | code: -› [code=PHP] | load:0.026s | speed:4.37 KB/s do tego miejsca: // Here's where the "Info Center" starts... // do --> powyższego miejsca
// Created by GeSHi 1.0.8.10 | code: -› [code=PHP] | load:0.026s | speed:2.97 KB/s I to wszystko, cały zawarty tam kod, czyli pomiędzy tymi // komentarzami: //top stats start. by [url=http://www.gorselsanatlar.org]www.gorselsanatlar.org[/url] echo '<br /> <div class="tborder" ', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'style="width: 100%;"' : '', '> <div class="catbg" style ="padding: 6px; vertical-align: middle; text-align: center; "> <a href ="#" onclick ="shrinkHeaderTOPS(!current_header_tops); return false;"><img id ="upshrink_tops" src ="', $settings['images_url'], '/', empty($options['collapse_header_tops']) ? 'collapse.gif' : 'expand.gif', '" alt ="*" title ="', $txt['upshrink_description'], '" style ="margin-right: 2ex;" align ="right" /></a > ', $txt[645], ' </div > <div id ="upshrinkHeaderTOPS"', empty($options['collapse_header_tops']) ? '' : ' style="display: none;"', '> <table border ="0" width ="100%" cellspacing ="1" cellpadding ="2" class="bordercolor"> <tr > <td class="titlebg" width ="10%" colspan ="2" align ="center">', $txt[302], ' ', $txt[331], '</td> <td class="titlebg" width ="24%" colspan ="2" align ="center">', $txt['top_topics_views'], '</td> <td class="titlebg" width ="66%" colspan ="3" align ="center">', $txt[214], '</td> </tr > <tr > <td class="windowbg2" width ="10%" colspan ="2" valign ="top"><span class="smalltext"><b >', $txt['user'], '</b></span><br />'; foreach ($context['new_members'] as $poster) { echo ' <img alt ="" src ="', $settings['images_url'], '/icons/online.gif', '" width ="12" height ="12" /> <span class="smalltext">',$poster['link'], '</span><br />'; } echo ' </td > <td class="windowbg2" width ="18%" valign ="top"><span class="smalltext"><b >', $txt[64], '</b></span><br />'; foreach ($context['top_topics_views'] as $topic) echo ' <img alt ="" src ="', $settings['images_url'], '/email_sm.gif', '" width ="12" /> <span class="smalltext">', $topic['link'], '</span><br />'; echo '</td> <td class="windowbg2" width ="6%" align ="right" valign ="top"><span class="smalltext"><b >', $txt[301], '</b></span><br />'; foreach ($context['top_topics_views'] as $topic) echo ' <img alt ="" src ="', $settings['images_url'], '/sort_up.gif" width ="8" /> <span class="smalltext">', $topic['num_views'], '</span><br />'; echo '</td> <td class="windowbg2" width ="22%" rowspan ="3" valign ="top"><span class="smalltext"><b >', $txt[64], '</b></span><br />'; if (!empty($context['latest_posts'])) foreach ($context['latest_posts'] as $post) echo ' <img src ="', $settings['images_url'], '/email_sm.gif', '" width ="12" alt ="" /> <span class="smalltext"><a href ="',$post['href'],'">', $post['short_subject'], '</a></span><br />'; echo '</td> <td class="windowbg2" width ="14%" rowspan ="3" valign ="top"><span class="smalltext"><b >', $txt[29], '</b></span><br />'; if (!empty($context['latest_posts'])) foreach ($context['latest_posts'] as $post) echo ' <img alt ="" src ="', $settings['images_url'], '/icons/online.gif', '" width ="12" height ="12" /> <span class="smalltext">', $post['poster']['link'], '</span><br />';
echo ' </td > <td class="windowbg2" width ="20%" rowspan ="3" valign ="top"><span class="smalltext"><b >', $txt[317], '</b></span><br />'; if (!empty($context['latest_posts'])) foreach ($context['latest_posts'] as $post) echo ' <img alt ="" src ="', $settings['images_url'], '/icons/calendar.gif', '" width ="12" /> <span class="smalltext">', $post['time'], '</span><br />'; echo '</td> </tr > <tr > <td class="titlebg" width ="20%" colspan ="2" align ="center">', $txt['top_posters'], '</td> <td class="titlebg" width ="24%" colspan ="2" align ="center">', $txt['top_topics'], '</td> </tr > <tr > <td class="windowbg2" width ="14%" valign ="top"><span class="smalltext"><b >', $txt['user'], '</b></span><br />'; foreach ($context['top_posters'] as $poster) echo ' <img alt ="" src ="', $settings['images_url'], '/icons/online.gif', '" width ="12" height ="12" /> <span class="smalltext">', $poster['link'], '</span><br />'; echo '</td> <td class="windowbg2" valign ="top" align ="right" width ="6%"><span class="smalltext"><b >', $txt[21], '</b></span><br />'; foreach ($context['top_posters'] as $poster) echo ' <img alt ="" src ="', $settings['images_url'], '/sort_up.gif" width ="8" /> <span class="smalltext">', $poster['num_posts'], '</span><br />'; echo '</td> <td class="windowbg2" valign ="top" width ="18%"><span class="smalltext"><b >', $txt['user'], '</b></span><br />'; foreach ($context['top_starters'] as $poster) echo ' <img alt ="" src ="', $settings['images_url'], '/icons/online.gif', '" width ="12" height ="12" /> <span class="smalltext">', $poster['link'], '</span><br />'; echo '</td> <td class="windowbg2" valign ="top" align ="right" width ="6%"><span class="smalltext"><b >', $txt[64], '</b></span><br />'; foreach ($context['top_starters'] as $poster) echo ' <img alt ="" src ="', $settings['images_url'], '/sort_up.gif" width ="8" /> <span class="smalltext">', $poster['num_topics'], '</span><br />'; echo '</td> </tr > </table > </div ></div >'; // Here's where the "Info Center" starts... // Created by GeSHi 1.0.8.10 | code: -› [code=PHP] | load:0.060s | speed:107.11 KB/s --->> zamień w całości na ten kod: //top stats start. by [url=http://www.gorselsanatlar.org]www.gorselsanatlar.org[/url] echo '<br /> <div class="tborder" ', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'style="width: 100%;"' : '', '> <div class="catbg" style ="padding: 6px; vertical-align: middle; text-align: center; "> <a href ="#" onclick ="shrinkHeaderTOPS(!current_header_tops); return false;"><img id ="upshrink_tops" src ="', $settings['images_url'], '/', empty($options['collapse_header_tops']) ? 'collapse.gif' : 'expand.gif', '" alt ="*" title ="', $txt['upshrink_description'], '" style ="margin-right: 2ex;" align ="right" /></a > ', $txt[645], '</div> <div id ="upshrinkHeaderTOPS"', empty($options['collapse_header_tops']) ? '' : ' style="display: none;"', '> <table width ="100%" cellspacing ="1" cellpadding ="2" class="bordercolor"> <tr >'; echo ' <td class="titlebg" width ="66%" colspan ="2" align ="center" style ="border-right:2px solid #ddd;">', $txt[214], '</td> <td class="titlebg" width ="44%" colspan ="2" align ="center">', $txt['top_topics_views'], '</td> </tr > <tr >'; echo ' <td class="windowbg2" style ="min-width:50%; vertical-align:top;"><span class="smalltext" style ="margin-left:15px; font-size:8pt; font-weight:500;"><b >', $txt[72], '</b></span><br />'; if (!empty($context['latest_posts'])) foreach ($context['latest_posts'] as $post) echo ' <span style ="font-size:8pt; font-weight:500; white-space:nowrap;"><a href ="',$post['href'],'"><img src ="', $settings['images_url'], '/email_sm.gif', '" style ="height:14px; vertical-align:middle;" alt ="Last Post" />', $post['subject'], '</a></span><br />';
echo ' </td > <td class="windowbg2" style ="border-right:2px solid #ddd; max-width:10%; vertical-align:top;"><span style ="margin-left:20px; font-size:8pt;"><b >', $txt[317], '</b></span><br />'; if (!empty($context['latest_posts'])) foreach ($context['latest_posts'] as $post) echo ' <span style ="margin-left:5px; font-size:8pt; font-weight:500;"><img alt ="Data" style ="height:14px; vertical-align:middle;" src ="', $settings['images_url'], '/icons/last_post.gif', '" />', $post['time'], '</span><br />'; echo '</td> <td class="windowbg2" style ="min-width:30%; vertical-align:top;"><span style ="margin-left:15px; font-size:8pt; font-weight:500;"><b >', $txt[70], '</b></span><br />'; foreach ($context['top_topics_views'] as $topic) echo ' <span style ="font-size:8pt; font-weight:500;"><img alt ="Topic" src ="', $settings['images_url'], '/email_sm.gif', '" style ="height:14px; vertical-align:middle;" />', $topic['link'], '</span><br />'; echo '</td> <td class="windowbg2" align ="center" style ="width:auto; vertical-align:top;"><span style ="font-size:8pt; font-weight:500;"><b >', $txt[301], '</b></span><br />'; foreach ($context['top_topics_views'] as $topic) echo ' <span style ="line-height:1.4em; font-size:8pt; font-weight:700;"><img alt ="" src ="', $settings['images_url'], '/sort_up.gif" style ="vertical-align:middle;" /> ', $topic['num_views'], '</span><br />'; echo '</td> </tr > </table > </div ></div >'; // Here's where the "Info Center" starts... // Created by GeSHi 1.0.8.10 | code: -› [code=PHP] | load:0.041s | speed:87.74 KB/s Jak widzisz podałem to łącznie z komentarzami, ale to dla lepszego trafienia  Tomeh, podałem to naprawdę prosto, łatwizna i spoko dasz radę, okay? I nie nadpisuj plików na servie tylko zmień straym nazwę przed wrzuceniem na FTP zmienionych plików, spoko? Edytuj tylko edytorem do kogu php z podświetlaniem składni np. Notepad++ Posłuchasz rad to max w 3 - 5 minut z wgraniem na serva.. tyle to pracy przy tym.. Pozdrawiam i na zdrowie, jak co to pisz  roco
Attention! Testing modifications - Steam Profile
|