vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Latest announcement on forum home (https://vborg.vbsupport.ru/showthread.php?t=97403)

olli666 02-26-2006 01:06 PM

Quote:

Originally Posted by Mr. Bone88
I don't seem to get how this works. I have installed it twice and removed it twice. I can't seem to find where I insert my text for it to appear in the latest announcement area. Where do I go to add my text?

Thanks,
~Mr. Bone88

Please, i can't find it too :ermm:

Shaikan 03-20-2006 12:30 PM

Nice plugin.

But I would need some additional features.
-) I have a multilanguage forum. So I would need that the Announcement changes depending on the forum language (so that I can enter for each language a forum where the last topic is taken for the annoucement).
-) I want that I can change the number of topics displayed in the annoucement field.

zeroality 07-25-2006 10:12 PM

This is a cool and simple hack. Could use a bit more functionality but I'm going to try to edit that in myself. I'll post the results here if I come up with something good.

zeroality 07-26-2006 09:34 AM

Edit: Alright, I've been playing around with this. It's probably nothing remarkable but I'm pretty proud of myself as I don't know mySQL or PHP and I had to do this via trial/error and am learning my way around.

This is my first experience in actually coding something in mySQL/php - all I've ever done before was move stuff around or follow file edit instructions.

Anyway - here's what I've gotten so far:
Attachment 51050

I did all this by editing the plugin code and the template code. Here is what I have for both:

Code:

<!-- Latest Announcement -->
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<thead>
        <tr>
                <td class="tcat" colspan="2"><a href="http://www.pokerealm.net/forums/forumdisplay.php?f=28">Latest News and Announcements</a></td>
        </tr>
</thead>
<tbody id="collapseobj_forumhome_events" style="$vbcollapse[collapseobj_forumhome_events]">
        <tr>
        <td class="thead" width="3%">&nbsp;</td>
        <td class="thead" width="97%">Recent Headlines</td>
        <tr>
        <td class="alt2" align="center"><img class="inlineimg" src="$stylevar[imgdir_statusicon]/announcement.gif" alt="News Icon"></td>
        <td class="alt2">$lns_show</td>
        </tr>
        <tr>
        <td class="alt1" colspan="2"><div class="smallfont">$lns2_show</div></td>
        </tr>
        <tr>
        <td class="alt2" align="center"><img class="inlineimg" src="$stylevar[imgdir_statusicon]/announcement.gif" alt="News Icon"></td>
        <td class="alt2">$lnsb_show</td>
        </tr>
        <tr>
        <td class="alt1" colspan="2"><div class="smallfont">$lnsb2_show</div></td>
        </tr>
</tbody>
</table>
<!-- /Latest Announcement -->

Code:

// ### LATEST NEWS BY TANTAWI ############################################
                $latesta = $db->query_first('SELECT title,threadid,views,replycount FROM ' . TABLE_PREFIX . 'thread WHERE 1 AND forumid = 28 ORDER BY dateline DESC  LIMIT 0 , 1');
                $lns_show = "<a href=\"showthread.php?"  . $vbulletin->session->vars['sessionurl'] . "t=$latesta[threadid]\">$latesta[title]</a>";
                $lns2_show = "<b>Replies:</b> $latesta[replycount] <b>Views:</b> $latesta[views]";
                $latesta2 = $db->query_first('SELECT title,threadid,views,replycount FROM ' . TABLE_PREFIX . 'thread WHERE 1 AND forumid = 28 ORDER BY dateline DESC  LIMIT 1 , 1');
                $lnsb_show = "<a href=\"showthread.php?"  . $vbulletin->session->vars['sessionurl'] . "t=$latesta2[threadid]\">$latesta2[title]</a>";
                $lnsb2_show = "<b>Replies:</b> $latesta2[replycount] <b>Views:</b> $latesta2[views]";

You can get an idea of how to edit the plugin once you compare my code to the original. Have fun guys.

I plan on adding a lot to this - I'm even thinking of asking someone how to trim phrases in PHP so that I can draw from the database and get the first post then trim it to 150 characters or so and display it right there under the title then a link "Read more...".

-Whoops, didn't mean to double post. I thought it would auto merge my posts.

zeroality 07-27-2006 05:49 AM

OK, I finally finished tinkering around with it and here is my finished product. If you have any questions, you can PM me. I'm not going to post it as a hack because I don't know how to write the admin CP plugin, etc. My code is probably very inefficient as well.

Attachment 51182

mshadows 08-18-2006 04:25 PM

This won't work for 3.6 - anyone have any ideas what changes I need to make to get it working? The Latest Announcement box will show but it's empty even though I have put in the correct forumid.

tantawi 08-18-2006 05:11 PM

mshadows, It works for me on on 3.6, nothing changed, you may need to rebuild threads info.

Regards.

mshadows 08-18-2006 07:29 PM

What do you mean by rebuild threads info? Sorry I'm a bit of a newbie with this kind of stuff.

tantawi 08-18-2006 08:48 PM

From your admincp, select Maintenance > Rebuild thread info.

Regards.

RobbieZ 09-20-2008 09:45 PM

Anyone got a 3.7.3 version ?


All times are GMT. The time now is 05:38 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01374 seconds
  • Memory Usage 1,742KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete