Announcement

Collapse
No announcement yet.

Managing Forum Announcements

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Originally posted by ZeroCool09
    so it means if I make a globle announcement, the users will see nothing if they only view the index ? is there any hacks that could makes the announcement to be displayed as normal posts ? (still be announcements but show in index as new posts ?)
    apply for global announcements .
    That would require something much more complex than the code I posted in this thread. I recommend you post on www.vbulletin.org for help with this.

    Comment


    • #17
      thks Jake, I will try with .org,
      thks you so much !

      Comment


      • #18
        I follow your guide but the announcement's subject doesnot display in post field in index.
        how can I fix ?

        Comment


        • #19
          Originally posted by ZeroCool09
          I follow your guide but the announcement's subject doesnot display in post field in index.
          how can I fix ?
          The instructions I posted in this thread only take care of the post and thread counts, not the last post field.

          I might be able to make some extra phpinclude_start code to fill in the last post field. I will get back to you on that.

          Comment


          • #20
            Originally posted by Jake Bunce
            The instructions I posted in this thread only take care of the post and thread counts, not the last post field.

            I might be able to make some extra phpinclude_start code to fill in the last post field. I will get back to you on that.
            thks and waiting for your reply.

            Comment


            • #21
              Yeah sorry, been busy.

              I will get to it as soon as I can.

              Comment


              • #22
                Ok. Here are my original instructions with the new code and instructions marked in green and the old code and instructions marked in red. The new code and instructions are for adding the last post info to the forum containing only announcements:

                You can use the announcement count instead of the post count by adding a query to your phpinclude_start template:

                Admin CP -> Styles & Templates -> Style Manager -> « » -> PHP Include Code Templates -> phpinclude_start

                Add this code:


                Code:
                [color=green]if (THIS_SCRIPT == 'index' OR THIS_SCRIPT == 'forumdisplay')
                {[/color]
                	[color=red]$announce_forumid = 3; 
                
                	$announce_count = $DB_site->query_first("SELECT COUNT(*) AS count
                		FROM " . TABLE_PREFIX . "announcement 
                		WHERE forumid = $announce_forumid [color=green]OR forumid = -1[/color]");[/color]
                
                	[color=green]$announce_last = $DB_site->query_first("SELECT announcementid, title, forumid, username, " . TABLE_PREFIX . "announcement.userid, startdate 
                		FROM " . TABLE_PREFIX . "announcement 
                		LEFT JOIN " . TABLE_PREFIX . "user ON (" . TABLE_PREFIX . "user.userid = " . TABLE_PREFIX . "announcement.userid) 
                		WHERE forumid = $announce_forumid OR forumid = -1
                		ORDER BY startdate
                		DESC
                		LIMIT 1");
                
                	$show[lastpostinfo] = 1;
                	if ($vboptions[lastthreadchars] AND strlen($announce_last[title]) > $vboptions[lastthreadchars])
                	{
                		$announce_last[title] = substr($announce_last[title], 0, $vboptions[lastthreadchars]) . "...";
                	}
                	$lastpostinfo[lastpostdate] = date($vboptions[dateformat], $announce_last[startdate]);
                
                	eval('$announce_last = "' . fetch_template('forumhome_lastpostby') . '";');
                }[/color]
                Change $announce_forumid appropriately.

                Then go to your:

                Admin CP -> Styles & Templates -> Style Manager -> « » -> Forum Home Templates -> forumhome_forumbit_level2_post

                Add the red/green code:


                Code:
                	<td class="alt2" nowrap="nowrap">[color=green]<if condition="$forum[forumid] == $GLOBALS[announce_forumid]">{$GLOBALS[announce_last]}<else />[/color]$forum[lastpostinfo][color=green]</if>[/color]</td>
                	<td class="alt1">[color=red]<if condition="$forum[forumid] == $GLOBALS[announce_forumid]">{$GLOBALS[announce_count][count]}<else />[/color]$forum[threadcount][color=red]</if>[/color]</td>
                	<td class="alt2">[color=red]<if condition="$forum[forumid] == $GLOBALS[announce_forumid]">{$GLOBALS[announce_count][count]}<else />[/color]$forum[replycount][color=red]</if>[/color]</td>
                	<td class="alt2" nowrap="nowrap">$forum[lastpostinfo]</td>
                	<if condition="$vboptions['showmoderatorcolumn']">
                	<td class="alt1"><div class="smallfont">$forum[moderators]&nbsp;</div></td>
                	</if>
                Then go to your:

                Admin CP -> Styles & Templates -> Style Manager -> « » -> Forum Home Templates -> forumhome_lastpostby

                Add the green code:


                Code:
                <if condition="$show['lastpostinfo']">
                <div class="smallfont" align="$stylevar[left]">
                	<div style="clear:both">
                		<if condition="$show['icon']"><img class="inlineimg" src="$icon[iconpath]" alt="$icon[title]" border="0" /></if>
                
                		[color=green]<if condition="$announce_forumid">
                		<a href="announcement.php?$session[sessionurl]f=$GLOBALS[announce_forumid]&amp;announcementid=$announce_last[announcementid]"><strong>$announce_last[title]</strong></a>
                		<else />[/color]
                
                		<a href="showthread.php?$session[sessionurl]goto=newpost&amp;t=$lastpostinfo[lastthreadid]" title="<phrase 1="$lastpostinfo[lastthread]">$vbphrase[go_first_unread_in_thread_x]</phrase>"><strong>$lastpostinfo[trimthread]</strong></a>
                
                		[color=green]</if>[/color]
                
                	</div>
                	<div<if condition="is_browser('ie', 6)"> style="float:$stylevar[left]"</if>>
                
                		[color=green]<if condition="$announce_forumid">
                		<phrase 1="member.php?$session[sessionurl]u=$announce_last[userid]" 2="$announce_last[username]">$vbphrase[by_x]</phrase>
                		<else />[/color]
                
                		<phrase 1="member.php?$session[sessionurl]find=lastposter&amp;f=$lastpostinfo[forumid]" 2="$lastpostinfo[lastposter]">$vbphrase[by_x]</phrase>
                
                		[color=green]</if>[/color]
                
                	</div>
                	<div align="$stylevar[right]">
                		$lastpostinfo[lastpostdate] <if condition="!$show['detailedtime']"><span class="time">$lastpostinfo[lastposttime]</span></if>
                
                		[color=green]<if condition="$announce_forumid">
                		<a href="announcement.php?$session[sessionurl]f=$GLOBALS[announce_forumid]&amp;announcementid=$announce_last[announcementid]"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>
                		<else />[/color]
                
                		<a href="showthread.php?$session[sessionurl]goto=lastpost&amp;t=$lastpostinfo[lastthreadid]"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>
                
                		[color=green]</if>[/color]
                
                	</div>
                </div>
                <else />
                <div class="smallfont" align="$stylevar[right]">
                	$lastpostinfo[lastpostdate] <if condition="!$show['detailedtime']"><span class="time">$lastpostinfo[lastposttime]</span></if>
                	<a href="showthread.php?$session[sessionurl]goto=lastpost&amp;t=$lastpostinfo[lastthreadid]"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>
                </div>
                </if>
                I tested this and it works.

                Comment

                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                Working...
                X