View Single Post
  #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
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01063 seconds
  • Memory Usage 1,778KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete