News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

News Box Mod by BurkeKnight Enterprises

Started by Burke ♞ Knight, November 10, 2008, 01:17:13 PM

Previous topic - Next topic

Burke ♞ Knight

Link to Mod

News Box Mod by BurkeKnight Enterprises

Version: 2.0 Date: 6/22/13
Compatibility: 1.1.x and 2.0

Made by: BurkeKnight - BurkeKnight Enterprises
This modification changes the random news box.

Instead of:
News: Your Site News Here

It shows:
Your Site News Here

This mod removes the News: title from the section, and it also centers, enlarges, and bolds the text for the news you enter through the Admin panel. This saves you from doing the center, size, and bold bbc tags.

Support:
If need support for this mod, please go to BurkeKnight Enterprises and register there.

We have a support ticket system for mod support.

We will no longer be supporting this mod here at the SMF site,
as we feel it is easier to keep all support at our site.


bullbreedluverz

is it possible to centre the news more?

i want it to be dead centre underneath my banner on my forum http://www.bullbreedluverz.com/smf

Burke ♞ Knight

You would need to remove the Search area.

You can remove that in the index.template.php file for the theme, which I assume is the default.

Find and Remove:
<td class="titlebg2" align="right" nowrap="nowrap" valign="top">
<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">
<a href="', $scripturl, '?action=search;advanced"><img src="'.$settings['images_url'].'/filter.gif" align="middle" style="margin: 0 1ex;" alt="" /></a>
<input type="text" name="search" value="" style="width: 190px;" />&nbsp;
<input type="submit" name="submit" value="', $txt[182], '" style="width: 11ex;" />
<input type="hidden" name="advanced" value="0" />';

// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="', $context['current_topic'], '" />';

// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';

echo '
</form>
</td>


Make sure to save a backup of the file before you edit it.

bullbreedluverz

erm that wouldnt really be a good solution for me as the search is used on my site to find posts on specific subjects

do you know if the news can be moved and centred to above the banner between the user name and the time?

Burke ♞ Knight

Personally, I'd rather use the Search button, but that's just me...LOL

Yes, you could move it there I suppose.
However, I don't have even a test site set up with the header like yours, so I can't tell you exactly where to put it on your index.template.php. After all, the news box is tied into the same area as the Search, with the second call for the upshrink of the header.

bullbreedluverz

a case of trial, error, break, fix, trial, error, break, fix, trial, error, break, fix, trial, error, break, fix, trial, error, break, fix........ till i get it right lol cheers anyway

Burke ♞ Knight

ROFL!!!! :)

Yes... That's how things often work out for people.... LOL

bullbreedluverz

ok scrap that im an idiot lol i forgot theres another search function on the menu bar i dont need the 1 in the banner area, cheers for the code to remove

Burke ♞ Knight

ROFL!!!!

That's why I found that the search button is my best friend for searching...LOL

bullbreedluverz

ok ok rub it in why dont you, yes im an idiot i know lmao

Burke ♞ Knight

LOL!

Hey, when I first did a site where I wanted the news fully centered, I tried moving the search into the user area. Did not work too well...LOL

bullbreedluverz

I did try moving the search box about but i ent no genius (ok you can stop laffing at me stating the obvious lol) and but didnt achieve anything but errors lol

you wouldnt happen to know how to do this change to the my messages button i posted a question about

http://www.simplemachines.org/community/index.php?topic=275407.0

Burke ♞ Knight

Go look at that post. Someone already responded...

bullbreedluverz


tk2012

Just a follow up on the question that was posted.  I would like the news centered as well, but the Ad Management Mod changes some of the code which you have posted.  Without screwing up that mod, is there a way just to move the start of the News portion down one line, so it doesn't start on the same place as the SEARCH bar? 

I would do that edit you have proposed, but like I said, there's changes to the code already for another mod.

and this is the default theme, just with color changes.  on 2.0 b4

Burke ♞ Knight

Actually, the ad mod does not effect the area of the search box.
Just the user area above that.
You can still safely remove the search box if you so wish, or put a <br /> in the front of your news, to drop it all down a line.

2.0 changed the way the news box displayed. Instead of it all being in it's own area, even when centered, it now uses the whole area, if more than one line, like seen in your screen shot. This made it so if want the whole news area to be identical, could just add the line break in front of the news. :)

tk2012

will try that...

something changes that area then because this is what I have:

<div id="news_section" class="titlebg2 clearfix"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
<form class="floatright" id="search_form" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
<a href="', $scripturl, '?action=search;advanced" title="', $txt['search_advanced'], '"><img id="advsearch" src="'.$settings['images_url'].'/filter.gif" align="middle" alt="', $txt['search_advanced'], '" /></a>
<input type="text" name="search" value="" style="width: 190px;" />&nbsp;
<input type="submit" name="submit" value="', $txt['search'], '" style="width: 11ex;" />
<input type="hidden" name="advanced" value="0" />';

// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="', $context['current_topic'], '" />';
// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';

echo '
</form>';

// Show a random news item? (or you could pick one from news_lines...)


Burke ♞ Knight

That looks default to me.

Nothing changed there that I can see.


The post above looks different, because it is 1.1.7 not 2.0 Beta 4. ;)

tk2012

Then, using what was posted, can you tell me which portions I should delete?  I don't want to screw up anything and I'm sure people using 2.0 would appreciate a posted fix as well.  I don't want to delete too much and since I do see some changes in there from the two codes, I don't want to cause any problems to anything else.


Burke ♞ Knight

#19
How to remove the search box, so can fully center the news in that whole area:

2.0 Beta 4:

Themes\default\index.template.php

Find:

<div id="news_section" class="titlebg2 clearfix"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
         <form class="floatright" id="search_form" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
            <a href="', $scripturl, '?action=search;advanced" title="', $txt['search_advanced'], '"><img id="advsearch" src="'.$settings['images_url'].'/filter.gif" align="middle" alt="', $txt['search_advanced'], '" /></a>
            <input type="text" name="search" value="" style="width: 190px;" />&nbsp;
            <input type="submit" name="submit" value="', $txt['search'], '" style="width: 11ex;" />
            <input type="hidden" name="advanced" value="0" />';

   // Search within current topic?
   if (!empty($context['current_topic']))
      echo '
            <input type="hidden" name="topic" value="', $context['current_topic'], '" />';
      // If we're on a certain board, limit it to this board ;).
   elseif (!empty($context['current_board']))
      echo '
            <input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';

   echo '
         </form>';

   // Show a random news item? (or you could pick one from news_lines...)



Replace with:

<div id="news_section" class="titlebg2 clearfix"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>';

   // Show a random news item? (or you could pick one from news_lines...)





1.1.x:

Find and Remove:

<td class="titlebg2" align="right" nowrap="nowrap" valign="top">
<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">
<a href="', $scripturl, '?action=search;advanced"><img src="'.$settings['images_url'].'/filter.gif" align="middle" style="margin: 0 1ex;" alt="" /></a>
<input type="text" name="search" value="" style="width: 190px;" />&nbsp;
<input type="submit" name="submit" value="', $txt[182], '" style="width: 11ex;" />
<input type="hidden" name="advanced" value="0" />';

// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="', $context['current_topic'], '" />';

// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';

echo '
</form>
</td>


Make sure to save a backup of the file before you edit it.

Advertisement: