Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-22-2002, 10:44 PM
Sho Sho is offline
 
Join Date: Nov 2001
Location: Berlin, Germany
Posts: 155
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Announcements on Forum Home

Hi,

I want to show announcement "bits" on forum home, just like in forumdisplay_threadlist, but using an own template. Could anyone help me?
Reply With Quote
  #2  
Old 08-22-2002, 10:53 PM
Vivi Ornitier's Avatar
Vivi Ornitier Vivi Ornitier is offline
 
Join Date: Nov 2001
Location: Black Mage Village
Posts: 442
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Do you want it so you can choose to put it on the index when you make the announcement?
Reply With Quote
  #3  
Old 08-22-2002, 10:59 PM
Sho Sho is offline
 
Join Date: Nov 2001
Location: Berlin, Germany
Posts: 155
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That'd be very cool, though I'm already satisfied when it only shows "global" announcements. To make forumhome an own entity in the whole "where to show announcement" system is probably much more work - not that I understand these things. If it is made so I have to chose whether or not to show on index, I have to be able to edit existing announcements.

Aside from that, I just want to be able to call some sort of "forumhome_announcement" template with $announcement in the forumhome template, so I can integrate the announcement title display flawlessly in my Welcome Panel thingie. Basically like in the threadlist.

Oh, and I'm running 2.2.6, FYI.
Reply With Quote
  #4  
Old 08-22-2002, 11:28 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

insert that in your index.php:
PHP Code:
// get announcements
$datenow=time();
$doneannouncements 0;
if (
$announcement=$DB_site->query_first("SELECT announcementid,startdate,title,user.username,user.userid,user.usertitle,user.customtitle
                                         FROM announcement
                                         LEFT JOIN user
                                           ON user.userid=announcement.userid
                                         WHERE startdate<=
$datenow AND enddate>=$datenow
                                           AND forumid='-1'
                                         ORDER BY startdate DESC
                                         LIMIT 1"
)) {
            unset(
$threadrating);
      
$backcolor '{firstaltcolor}';
          
$bgclass "alt1";

     if (
$announcement[customtitle]==2) {
       
$announcement[usertitle] = htmlspecialchars($announcement[usertitle]);
         }
        
$announcement[postdate]=vbdate($dateformat,$announcement[startdate]);

  if (
$announcement[startdate]>$bbuserinfo[lastvisit]) {
      
$announcement[icon]='newannounce.gif';
  } else {
      
$announcement[icon]='announce.gif';
  }
  eval(
"\$announcement = \"".gettemplate('forumhome_announcement')."\";");
  
$doneannouncements 1;

just before this:
PHP Code:
//Forum info
$forums=$DB_site->query('SELECT * FROM forum WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder');
while (
$forum=$DB_site->fetch_array($forums)) {
    
$iforumcache["$forum[parentid]"]["$forum[displayorder]"]["$forum[forumid]"] = $forum;
}
$DB_site->free_result($forums);
unset(
$forum); 

as you can see i've just renamed the template names, just create these and style em as you want
you can use $announcement in your forumhome template now


i hope it works, it's not fine but should work
Reply With Quote
  #5  
Old 08-22-2002, 11:37 PM
Sho Sho is offline
 
Join Date: Nov 2001
Location: Berlin, Germany
Posts: 155
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works! Thanks for the fast help, Xenon!

Two questions, though:

a) This will show only global announcements, yes?

b) Shouldn't I add "forumhome_announcement" to $templatesused in index.php? I have no idea what purpose this line serves, just curious.
Reply With Quote
  #6  
Old 08-22-2002, 11:43 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

a) i think so

b)yes you should add it to templateused

it'll reduce the ammount of querys
Reply With Quote
  #7  
Old 08-22-2002, 11:46 PM
Sho Sho is offline
 
Join Date: Nov 2001
Location: Berlin, Germany
Posts: 155
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Xenon
it'll reduce the ammount of querys
Great! Thanks again, Xenon!
Reply With Quote
  #8  
Old 12-25-2003, 04:21 AM
himerus himerus is offline
 
Join Date: Nov 2003
Location: Denver, CO
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'd like to see if anyone has this hack running on Gamma? Could someone post or PM me a link if you do?! TIA!!
Reply With Quote
  #9  
Old 12-25-2003, 05:28 AM
MindTrix's Avatar
MindTrix MindTrix is offline
 
Join Date: Apr 2002
Location: United Kingdom
Posts: 1,833
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try over at www.vbulletin.nl for vB3 hacks. You need to make more than 2 posts, and then wait a hour before you can download over there though.
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 02:48 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.04615 seconds
  • Memory Usage 2,256KB
  • Queries Executed 11 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete