Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Latest announcement on forum home Details »»
Latest announcement on forum home
Version: 1.2, by tantawi tantawi is offline
Developer Last Online: Oct 2011 Show Printable Version Email this Page

Version: 3.5.4 Rating:
Released: 10-01-2005 Last Update: 01-10-2006 Installs: 50
Uses Plugins Template Edits
 
No support by the author.

This is my first hack which I created out of necessity. It's is so simple, it adds "Last Announcement" in the forums home. This is done by selecting the latest thread created in a given forum to be displayed.

See the screenshot attached.

1.2 Update:
- The hack now uses the plugin system, no more code changes .

1.1 Update:
- Code is now more optimized, compatible with non-cookied and clustered boards. (Thanks for KirbyDE)

1.01 Update:
- Now it works if you use prefix in database.

Enjoy

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 02-26-2006, 01:06 PM
olli666 olli666 is offline
 
Join Date: Nov 2005
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
Reply With Quote
  #23  
Old 03-20-2006, 12:30 PM
Shaikan Shaikan is offline
 
Join Date: Feb 2006
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #24  
Old 07-25-2006, 10:12 PM
zeroality zeroality is offline
 
Join Date: Jul 2006
Posts: 187
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #25  
Old 07-26-2006, 09:34 AM
zeroality zeroality is offline
 
Join Date: Jul 2006
Posts: 187
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #26  
Old 07-27-2006, 05:49 AM
zeroality zeroality is offline
 
Join Date: Jul 2006
Posts: 187
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #27  
Old 08-18-2006, 04:25 PM
mshadows mshadows is offline
 
Join Date: Jun 2006
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #28  
Old 08-18-2006, 05:11 PM
tantawi tantawi is offline
 
Join Date: Sep 2002
Location: Egypt
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Regards.
Reply With Quote
  #29  
Old 08-18-2006, 07:29 PM
mshadows mshadows is offline
 
Join Date: Jun 2006
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What do you mean by rebuild threads info? Sorry I'm a bit of a newbie with this kind of stuff.
Reply With Quote
  #30  
Old 08-18-2006, 08:48 PM
tantawi tantawi is offline
 
Join Date: Sep 2002
Location: Egypt
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

From your admincp, select Maintenance > Rebuild thread info.

Regards.
Reply With Quote
  #31  
Old 09-20-2008, 09:45 PM
RobbieZ RobbieZ is offline
 
Join Date: Jul 2008
Posts: 1,117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone got a 3.7.3 version ?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:37 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04474 seconds
  • Memory Usage 2,308KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete