nneonneo's Shoutbox

Started by nneonneo, December 26, 2006, 06:58:11 PM

Previous topic - Next topic

ionic84

hello,

is it possible to run this shoutbox with the ds natural theme ? (http://custom.simplemachines.org/themes/index.php?lemma=749)
i like that theme and i spent the whole day to get that shoutbox working, but it wont like i want to...
i followed the steps for custom themes, and the shoutbox appears, but i cant submit shouts

i tried it with 1.1.5 and upgraded to  version 2.0 beta 3.1

i would like to have it above the menu bar in that style

thanks a lot !

Encore127

How do you make a table for my theme? Here's my code

BoardIndex.template
<?php
// Version: 1.1; BoardIndex

function template_main()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;

// Show some statistics next to the link tree if SP1 info is off.
echo '
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td valign="bottom">'
, theme_linktree(), '</td>
<td align="right">'
;
if (!$settings['show_sp1_info'])
echo '
'
, $txt[19], ': ', $context['common_stats']['total_members'], ' &nbsp;&#38;#8226;&nbsp; ', $txt[95], ': ', $context['common_stats']['total_posts'], ' &nbsp;&#38;#8226;&nbsp; ', $txt[64], ': ', $context['common_stats']['total_topics'], '
'
, ($settings['show_latest_member'] ? '<br />' . $txt[201] . ' <b>' . $context['common_stats']['latest_member']['link'] . '</b>' . $txt[581] : '');
echo '
</td>
</tr>
</table>'
;

// Show the news fader?  (assuming there are things to show...)
if ($settings['show_newsfader'] && !empty($context['fader_news_lines']))
{
echo '
<table border="0" width="100%" class="tborder" cellspacing="'
, ($context['browser']['is_ie'] || $context['browser']['is_opera6']) ? '1' : '0' , '" cellpadding="4" style="margin-bottom: 2ex;">
<tr>
<td class="catbg"> &nbsp;'
, $txt[102], '</td>
</tr>
<tr>
<td valign="middle" align="center" height="60">'
;

// Prepare all the javascript settings.
echo '
<div id="smfFadeScroller" style="width: 90%; padding: 2px;"><b>'
, $context['news_lines'][0], '</b></div>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
// The fading delay (in ms.)
var smfFadeDelay = '
, empty($settings['newsfader_time']) ? 5000 : $settings['newsfader_time'], ';
// Fade from... what text color? To which background color?
var smfFadeFrom = {"r": 0, "g": 0, "b": 0}, smfFadeTo = {"r": 255, "g": 255, "b": 255};
// Surround each item with... anything special?
var smfFadeBefore = "<b>", smfFadeAfter = "</b>";

var foreColor, backEl, backColor;

if (typeof(document.getElementById(\'smfFadeScroller\').currentStyle) != "undefined")
{
foreColor = document.getElementById(\'smfFadeScroller\').currentStyle.color.match(/#([\da-f][\da-f])([\da-f][\da-f])([\da-f][\da-f])/);
smfFadeFrom = {"r": parseInt(foreColor[1]), "g": parseInt(foreColor[2]), "b": parseInt(foreColor[3])};

backEl = document.getElementById(\'smfFadeScroller\');
while (backEl.currentStyle.backgroundColor == "transparent" && typeof(backEl.parentNode) != "undefined")
backEl = backEl.parentNode;

backColor = backEl.currentStyle.backgroundColor.match(/#([\da-f][\da-f])([\da-f][\da-f])([\da-f][\da-f])/);
smfFadeTo = {"r": eval("0x" + backColor[1]), "g": eval("0x" + backColor[2]), "b": eval("0x" + backColor[3])};
}
else if (typeof(window.opera) == "undefined" && typeof(document.defaultView) != "undefined")
{
foreColor = document.defaultView.getComputedStyle(document.getElementById(\'smfFadeScroller\'), null).color.match(/rgb\((\d+), (\d+), (\d+)\)/);
smfFadeFrom = {"r": parseInt(foreColor[1]), "g": parseInt(foreColor[2]), "b": parseInt(foreColor[3])};

backEl = document.getElementById(\'smfFadeScroller\');
while (document.defaultView.getComputedStyle(backEl, null).backgroundColor == "transparent" && typeof(backEl.parentNode) != "undefined" && typeof(backEl.parentNode.tagName) != "undefined")
backEl = backEl.parentNode;

backColor = document.defaultView.getComputedStyle(backEl, null).backgroundColor.match(/rgb\((\d+), (\d+), (\d+)\)/);
smfFadeTo = {"r": parseInt(backColor[1]), "g": parseInt(backColor[2]), "b": parseInt(backColor[3])};
}

// List all the lines of the news for display.
var smfFadeContent = new Array(
"'
, implode('",
"'
, $context['fader_news_lines']), '"
);
// ]]></script>
<script language="JavaScript" type="text/javascript" src="'
, $settings['default_theme_url'], '/fader.js"></script>
</td>
</tr>
</table>'
;

}

     
// YSHOUT HERE
     
echo '
                    <br /><b>Shout Box</b><br /><br />
                    <div id="yshout">'
,$txt['yshout_loading'],'<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div>';
     
// YSHOUT END

/* Each category in categories is made up of:
id, href, link, name, is_collapsed (is it collapsed?), can_collapse (is it okay if it is?),
new (is it new?), collapse_href (href to collapse/expand), collapse_image (up/down image),
and boards. (see below.) */
$first = true;
foreach ($context['categories'] as $category)
{
echo '
<div style="margin-top: '
, $first ? '0;' : '1ex;' , '' , $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'width: 100%;' : '', '">
<div class="menu">'
;
$first = false;
// If this category even can collapse, show a link to collapse it.
if ($category['can_collapse'])
echo '


Index.template
<?php
// Version: 1.1.5; index

/* This template is, perhaps, the most important template in the theme. It
contains the main template layer that displays the header and footer of
the forum, namely with main_above and main_below. It also contains the
menu sub template, which appropriately displays the menu; the init sub
template, which is there to set the theme up; (init can be missing.) and
the linktree sub template, which sorts out the link tree.

The init sub template should load any data and set any hardcoded options.

The main_above sub template is what is shown above the main content, and
should contain anything that should be shown up there.

The main_below sub template, conversely, is shown after the main content.
It should probably contain the copyright statement and some other things.

The linktree sub template should display the link tree, using the data
in the $context['linktree'] variable.

The menu sub template should display all the relevant buttons the user
wants and or needs.

For more information on the templating system, please see the site at:
http://www.simplemachines.org/
*/

// Initialize the template... mainly little settings.
function template_init()
{
global $context, $settings, $options, $txt;

/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';

/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';

/* The version this template/theme is for.
This should probably be the version of SMF it was created for. */
$settings['theme_version'] = '1.1';

/* Set a setting that tells the theme that it can render the tabs. */
$settings['use_tabs'] = true;

/* Use plain buttons - as oppossed to text buttons? */
$settings['use_buttons'] = true;

/* Show sticky and lock status seperate from topic icons? */
$settings['seperate_sticky_lock'] = true;
}

// The main sub template above the content.
function template_main_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"'
, $context['right_to_left'] ? ' dir="rtl"' : '', '><head>
<meta http-equiv="Content-Type" content="text/html; charset='
, $context['character_set'], '" />
<meta name="description" content="'
, $context['page_title'], '" />', empty($context['robot_no_index']) ? '' : '
<meta name="robots" content="noindex" />'
, '
<meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
<script language="JavaScript" type="text/javascript" src="'
, $settings['default_theme_url'], '/script.js?fin11"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "'
, $settings['theme_url'], '";
var smf_images_url = "'
, $settings['images_url'], '";
var smf_scripturl = "'
, $scripturl, '";
var smf_iso_case_folding = '
, $context['server']['iso_case_folding'] ? 'true' : 'false', ';
var smf_charset = "'
, $context['character_set'], '";
// ]]></script>
<title>'
, $context['page_title'], '</title>';

// The ?fin11 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<link rel="stylesheet" type="text/css" href="'
, $settings['theme_url'], '/style.css?fin11" />
<link rel="stylesheet" type="text/css" href="'
, $settings['default_theme_url'], '/print.css?fin11" media="print" />';

/* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
Standards compliance mode happens when you use xhtml... */
if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="'
, $settings['default_theme_url'], '/fonts-compat.css" />';
// YSHOUT HERE
 
global $boardurl;
  echo
'
  <script src="'
,$boardurl,'/yshout/js/prototype.js" type="text/javascript"></script>
  <script src="'
,$boardurl,'/yshout/js/moo.ajax.js" type="text/javascript"></script>
  <script src="'
,$boardurl,'/yshout/js/behaviour.js" type="text/javascript"></script>
  <script src="'
,$boardurl,'/yshout/js/domFunction.js" type="text/javascript"></script>
  <script type="text/javascript">

  var myfunc = new domFunction(function()
  {
     loadChat();
  }, { "yshout":"id"});
  var board_url = "'
; $boardurlparsed = parse_url($boardurl); echo (isset($boardurlparsed['path'])?$boardurlparsed['path']:""), '";

  </script>
  <script src="'
,$boardurl,'/yshout/js/yshout.js?May122008" type="text/javascript"></script>
  <script type="text/javascript">var shoutFile = "home.txt";</script>
  <style type="text/css">
     #yshout {
        font-size: 10px;
     }
     #yshout p {
        margin: 0 0 0; /* Top Bottom Linespacing */
     }
     .shout-invalid {
        background: #FFFDD1;
     }
     #yshout fieldset {
        border: none;
     }
     #yshout em {
        font-style: normal;
     }
     #yshout p {
        line-height: 1;
        margin-top: 0;
     }
     #yshout {
        overflow: hidden;
     }
     #yshout .shout-timestamp {
        font-weight: normal;
        color: #000;
     }
     #yshout .adminlink {
        font-size: 6pt;
        color: #141414;
     }
     #forum-name, #shout-text, #shout-button {
        font-size: 9px;
        margin: 0;
        padding: 0;
     }
     #yshout #forum-name {
        color: #666666;
        width: 70px;
        margin-right: 5px;
     }
     #yshout #shout-text {
        color: #000000;
        width: 310px;
        margin-right: 5px;
     }
     #yshout #shout-button {
        width: 55px;
     }
  </style>'
;
 
// YSHOUT END
// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="'
, $scripturl, '?action=help" target="_blank" />
<link rel="search" href="'
. $scripturl . '?action=search" />
<link rel="contents" href="'
, $scripturl, '" />';

// If RSS feeds are enabled, advertise the presence of one.
if (!empty($modSettings['xmlnews_enable']))
echo '
<link rel="alternate" type="application/rss+xml" title="'
, $context['forum_name'], ' - RSS" href="', $scripturl, '?type=rss;action=.xml" />';

// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href="'
, $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=prev" />
<link rel="next" href="'
, $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=next" />';

// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="'
. $scripturl . '?board=' . $context['current_board'] . '.0" />';

// We'll have to use the cookie to remember the header...
if ($context['user']['is_guest'])
{
$options['collapse_header'] = !empty($_COOKIE['upshrink']);
$options['collapse_header_ic'] = !empty($_COOKIE['upshrinkIC']);
}

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '

<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header = '
, empty($options['collapse_header']) ? 'false' : 'true', ';

function shrinkHeader(mode)
{'
;

// Guests don't have theme options!!
if ($context['user']['is_guest'])
echo '
document.cookie = "upshrink=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "'
, $context['session_id'], '");';

echo '
document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";
document.getElementById("upshrinkHeader2").style.display = mode ? "none" : "";

current_header = mode;
}
// ]]></script>'
;

// the routine for the info center upshrink
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header_ic = '
, empty($options['collapse_header_ic']) ? 'false' : 'true', ';

function shrinkHeaderIC(mode)
{'
;

if ($context['user']['is_guest'])
echo '
document.cookie = "upshrinkIC=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "'
, $context['session_id'], '");';

echo '
document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");

document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";

current_header_ic = mode;
}
// ]]></script>
</head>
<body>'
;
echo
'

<div class="orta">
<div style="padding: 0px 15px 0px 15px;">
<img src="'
, $settings['images_url'], '/logo.gif" alt="Logo" />
</div>
</div>
<div class="alt"></div>
'
;




// display user name
echo '

<div class="ust"></div>
<div class="orta">
<div style="padding: 0px 15px 0px 15px;">

<div class="c_ust"></div>
<div class="c_orta">
<div style="padding: 0px 2px 0px 2px;">

<table width="100%" cellpadding="4" cellspacing="0" border="0" >
<tr class="catbg">'
;
echo'
<td align="left"><span class="smalltext">'
, $context['current_time'], '</span></td>
'
;



echo '
<td align="right" nowrap="nowrap" valign="top">
<form action="'
, $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">
<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>
</tr>

'
;



// this is the upshrink button for the user info section
echo '

<tr id="upshrinkHeader"'
, empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
<td valign="top" colspan="2">
<table width="100%" class="bordercolor" cellpadding="8" cellspacing="1" border="0" style="margin-top: 1px;">
<tr>'
;
echo'
<td class="smalltext" align="left" width="40%">

<img style="margin-right:5px;" src="'
. $settings['images_url'] . '/on.gif" width="12" height="12" alt="' . $txt[333] . '"/><b>', $txt[489], ':</b>  ', $context['common_stats']['total_posts'], ' <br />
<img style="margin-right:5px;" src="'
. $settings['images_url'] . '/on.gif" width="12" height="12" alt="' . $txt[333] . '"/><b>', $txt[490], ':</b>  ', $context['common_stats']['total_topics'], '<br />
<img style="margin-right:5px;" src="'
. $settings['images_url'] . '/on.gif" width="12" height="12" alt="' . $txt[333] . '"/><b>', $txt[488], ':</b>  ', $context['common_stats']['total_members'], '<br />
<img style="margin-right:5px;" src="'
. $settings['images_url'] . '/on.gif" width="12" height="12" alt="' . $txt[333] . '"/><b>', $txt[656], ': </b> ', $context['common_stats']['latest_member']['link'], '
</td>

<td align="right" colspan="2" width="50%" valign="top" class="windowbg2"><span class="smalltext">'
;

// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo'
'
, $txt['hello_member_ndt'], ' <b>', $context['user']['name'] , '</b><br />
'
;

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
echo  '', $txt[152], ' <a href="', $scripturl, '?action=pm">', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt[153] : $txt[471], '</a>', $txt['newmessages4'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'];
echo '.<br />';
echo '
<a href="'
, $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a> <br />
<a href="'
, $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />';

}
// Otherwise they're a guest - send them a lovely greeting...
else
echo $txt['welcome_guest'];


// Now, onto our second set of info, are they logged in again?
if ($context['user']['is_logged'])
{
// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '
<b>'
, $txt[616], '</b><br />';

// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '
'
, $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '<br />';

// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']))
{
echo '
'
, $txt['totalTimeLogged1'];

// If days is just zero, don't bother to show it.
if ($context['user']['total_time_logged_in']['days'] > 0)
echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];

// Same with hours - only show it if it's above zero.
if ($context['user']['total_time_logged_in']['hours'] > 0)
echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];

// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';
}
echo ' </span>';
}
// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
else
{
echo ' </span>
<script language="JavaScript" type="text/javascript" src="'
, $settings['default_theme_url'], '/sha1.js"></script>

<form action="'
, $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" class="middletext" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
<select name="cookielength">
<option value="60">'
, $txt['smf53'], '</option>
<option value="1440">'
, $txt['smf47'], '</option>
<option value="10080">'
, $txt['smf48'], '</option>
<option value="43200">'
, $txt['smf49'], '</option>
<option value="-1" selected="selected">'
, $txt['smf50'], '</option>
</select>
<input type="submit" value="'
, $txt[34], '" /><br />
<span class="middletext">'
, $txt['smf52'], '</span>
<input type="hidden" name="hash_passwrd" value="" />
</form>'
;
}

echo '
</td>'
;
if (!empty($context['user']['avatar']))
echo '
<td class="windowbg" valign="middle">'
, $context['user']['avatar']['image'], '</td>';
echo
'

</tr>
</table>
</td>
</tr>
</table>'
;

echo '

</div></div>
<div class="c_alt"></div>

</div></div>
<div class="alt"></div>
'
;


// Show the menu here, according to the menu sub template.
template_menu();


// The main content should go here.
echo '
<div class="ust"></div>
<div class="orta">
<div id="bodyarea" style="padding: 0px 15px 0px 15px;">'
;
}

function
template_main_below()
{
global $context, $settings, $options, $scripturl, $txt;

echo '
</div></div>
<div class="alt"></div>'
;

// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '
<div class="ust"></div>
<div class="orta">
<div id="footerarea" style="text-align: center; padding-bottom: 1ex;'
, $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' : '', '">
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function smfFooterHighlight(element, value)
{
element.src = smf_images_url + "/" + (value ? "h_" : "") + element.id + ".gif";
}
// ]]></script>
<table cellspacing="0" cellpadding="3" border="0" align="center" width="100%">
<tr>

<td class="smalltext" valign="middle" align="center" style="white-space: nowrap;">
'
, tema_copyright(), '
</td>

</tr>
</table>'
;

// Show the load time?
if ($context['show_load_time'])
echo '
<span class="smalltext">'
, $txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';

// This is an interesting bug in Internet Explorer AND Safari. Rather annoying, it makes overflows just not tall enough.
if (($context['browser']['is_ie'] && !$context['browser']['is_ie4']) || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'] || $context['browser']['is_firefox'])
{
// The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA['
;

// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
if ($context['browser']['is_safari'])
echo '
window.addEventListener("load", smf_codeFix, false);

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if ((codeFix[i].className == "code" || codeFix[i].className == "post" || codeFix[i].className == "signature") && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
}
}'
;
elseif ($context['browser']['is_firefox'])
echo '
window.addEventListener("load", smf_codeFix, false);
function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if (codeFix[i].className == "code" && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0))
codeFix[i].style.overflow = "scroll";
}
}'
;
else
echo '
var window_oldOnload = window.onload;
window.onload = smf_codeFix;

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = codeFix.length - 1; i > 0; i--)
{
if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0) && (codeFix[i].offsetHeight != 0 || codeFix[i].className == "code"))
codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
}

if (window_oldOnload)
{
window_oldOnload();
window_oldOnload = null;
}
}'
;

echo '
// ]]></script>'
;
}

echo '
</div></div>'
;

// The following will be used to let the user know that some AJAX process is running
echo '
<div id="ajax_in_progress" style="display: none;'
, $context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' : '', '">', $txt['ajax_in_progress'], '</div>
</body></html>'
;
}

// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
global $context, $settings, $options;

echo '<div class="nav" style="font-size: smaller; margin-bottom: 2ex; margin-top: 0;">';

// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Show the link, including a URL if it should have one.
echo '<b>', $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="nav">' . $tree['name'] . '</a>' : $tree['name'], '</b>';

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo '&nbsp;>&nbsp;';
}

echo '</div>';
}

// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;


// Show the start of the tab section.
echo '

<div class="ust"></div>
<div class="orta">
<div class="buton">
<ul>'
;
       
// Show the [Home] button.
       
echo '<li><a' , $current_action=='Home' ? ' class="current"' : '' , ' href="http://republic.silverinstitute.com/forums/index.php?action=forum"><span>Home</span></a></li>';

// Show the [help] button.
echo'
<li><a href="'
, $scripturl, '?action=help">' , $txt[119] , '</a></li>
'
;

// How about the [search] button?
if ($context['allow_search'])
echo'
<li><a href="'
, $scripturl, '?action=search">' , $txt[182] , '</a></li>
'
;

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo'
<li><a href="'
, $scripturl, '?action=admin">' , $txt[2] , '</a></li>
'
;

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo'
<li><a href="'
, $scripturl, '?action=profile">' , $txt[79] , '</a></li>
'
;

// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo'
<li><a href="'
, $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a></li>
'
;

// The [calendar]!
if ($context['allow_calendar'])
echo'
<li><a href="'
, $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a></li>
'
;
       
// Show the [Gallery] button.
       
echo '<li><a' , $current_action=='Gallery' ? ' class="current"' : '' , ' href="http://republic.silverinstitute.com/forums/index.php?action=gallery"><span>Gallery</span></a></li>';

// the [member] list button
if ($context['allow_memberlist'])
echo'
<li><a href="'
, $scripturl, '?action=mlist">' , $txt[331] , '</a></li>
'
;


// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo'
<li><a href="'
, $scripturl, '?action=login">' , $txt[34] , '</a></li>
'
;


// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo'
<li><a href="'
, $scripturl, '?action=register">' , $txt[97] , '</a></li>
'
;


// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo'
<li><a href="'
, $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a></li>
'
;


// The end of tab section.
echo '
</ul>
</div>
</div>
<div class="alt"></div>'
;
}
// Generate a strip of buttons.
function template_button_strip($button_strip, $direction = 'top', $force_reset = false, $custom_td = '')
{
global $settings, $buttons, $context, $txt, $scripturl;

// Create the buttons...
foreach ($button_strip as $key => $value)
{
if (isset($value['test']) && empty($context[$value['test']]))
{
unset($button_strip[$key]);
continue;
}
elseif (!isset($buttons[$key]) || $force_reset)
$buttons[$key] = '<a href="' . $value['url'] . '" ' .( isset($value['custom']) ? $value['custom'] : '') . '>' . $txt[$value['text']] . '</a>';

$button_strip[$key] = $buttons[$key];
}

if (empty($button_strip))
return '<td>&nbsp;</td>';

echo '
<td class="'
, $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'last' : 'first' , '">&nbsp;</td>
<td class="'
, $direction == 'top' ? 'main' : 'mirror', 'tab_back">', implode(' &nbsp;|&nbsp; ', $button_strip) , '</td>
<td class="'
, $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'first' : 'last' , '">&nbsp;</td>';
}
//no deleted
function tema_copyright()
{
echo'  
'
, theme_copyright(), ' <br /> <span style="color:efefef;">Oranj By </span><a href="http://www.smftr.com" title="smf">Burak</a>
'
;
}

?>

MissRancher

Quote from: nneonneo on July 19, 2008, 12:21:41 PM
@MissRancher: It's really not a good idea to rename the div, since that could cause problems...I don't understand why it would load the whole forum, unless the index.php modifications were wrong (for 1.20) or you were using SB_1.16 or earlier with certain forum setups. Anyway, a forum URL (and preferably an account too) would make this easier to debug (<3 Firebug)

Thanks! I actually went with a clean install of the theme, left the div name alone, and it started working. Magic.

Now I'm seeing TONS of errors in my smf log table such as:

Undefined index: yshout_shout_button<br />File: /home/blah/public_html/mysite/yshout/yshout.php<br />Line: 302
Undefined index: yshout_commands<br />File: /home/blah/public_html/mysite/yshout/yshout.php<br />Line: 247
Undefined index: yshout_shoutbox<br />File: /home/blah/public_html/mysite/Themes/mytheme/BoardIndex.template.php (main_above sub template - eval?)<br />Line: 353

And I'm trying to figure out why...any thoughts?



assam_siddibapa

Quote from: nneonneo on July 28, 2008, 11:07:49 PM
No, you want to edit the makeShout function itself. As for making it look like a board, well, you have to copy the specific code from BoardIndex.template.php or something to make it look proper (I've gotten the best results copying the code from the Recent Posts box, though)
[/quot
Quote from: nneonneo on July 29, 2008, 03:10:38 PM
@assam_siddibapa: I don't quite understand what you asked :(. For making the shoutbox appear as a category, see this post


e]


Ya this is what i want .... how do i do that

MissRancher

Quote from: MissRancher on July 29, 2008, 10:03:07 PM
Quote from: nneonneo on July 19, 2008, 12:21:41 PM
@MissRancher: It's really not a good idea to rename the div, since that could cause problems...I don't understand why it would load the whole forum, unless the index.php modifications were wrong (for 1.20) or you were using SB_1.16 or earlier with certain forum setups. Anyway, a forum URL (and preferably an account too) would make this easier to debug (<3 Firebug)

Thanks! I actually went with a clean install of the theme, left the div name alone, and it started working. Magic.

Now I'm seeing TONS of errors in my smf log table such as:

Undefined index: yshout_shout_button<br />File: /home/blah/public_html/mysite/yshout/yshout.php<br />Line: 302
Undefined index: yshout_commands<br />File: /home/blah/public_html/mysite/yshout/yshout.php<br />Line: 247
Undefined index: yshout_shoutbox<br />File: /home/blah/public_html/mysite/Themes/mytheme/BoardIndex.template.php (main_above sub template - eval?)<br />Line: 353

And I'm trying to figure out why...any thoughts?

Yes, quoting myself...I had added the mods to the language-english file, but not the english-utf8 file, which I *think* is the problem.

nneonneo

@MissRancher: Or, your theme has its own Modifications.english.php file, which you need to modify

@ionic84: Post index.template.php (modified)

@Encore127: What do you mean by a table? If you mean a category box, see http://www.simplemachines.org/community/index.php?topic=137508.msg1635410#msg1635410

@assam_sidibapa: Read that post, and try the suggestion. You'll need to know at least a little HTML to make it look decent.
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

ionic84

<?php
// Version: 1.1.5; index

// Initialize the template... mainly little settings.
function template_init()
{
global $context, $settings, $options, $txt;
/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';
/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';
/* The version this template/theme is for.
This should probably be the version of SMF it was created for. */
$settings['theme_version'] = '1.1';
/* Set a setting that tells the theme that it can render the tabs. */
$settings['use_tabs'] = true;
/* Use plain buttons - as oppossed to text buttons? */
$settings['use_buttons'] = true;
/* Show sticky and lock status seperate from topic icons? */
$settings['seperate_sticky_lock'] = true;
}
// The main sub template above the content.
function template_main_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"'
, $context['right_to_left'] ? ' dir="rtl"' : '', '><head>
<meta http-equiv="Content-Type" content="text/html; charset='
, $context['character_set'], '" />
<meta name="description" content="'
, $context['page_title'], '" />', empty($context['robot_no_index']) ? '' : '
<meta name="robots" content="noindex" />'
, '
<meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
<script language="JavaScript" type="text/javascript" src="'
, $settings['default_theme_url'], '/script.js?fin11"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "'
, $settings['theme_url'], '";
var smf_images_url = "'
, $settings['images_url'], '";
var smf_scripturl = "'
, $scripturl, '";
var smf_iso_case_folding = '
, $context['server']['iso_case_folding'] ? 'true' : 'false', ';
var smf_charset = "'
, $context['character_set'], '";
// ]]></script>
<title>'
, $context['page_title'], '</title>';
// The ?fin11 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<link rel="stylesheet" type="text/css" href="'
, $settings['theme_url'], '/style.css?fin11" />
<link rel="stylesheet" type="text/css" href="'
, $settings['theme_url'], '/css/yshout.css?July022008" />
<link rel="stylesheet" type="text/css" href="'
, $settings['default_theme_url'], '/print.css?fin11" media="print" />';
/* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
Standards compliance mode happens when you use xhtml... */
if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="'
, $settings['default_theme_url'], '/fonts-compat.css" />';

// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="'
, $scripturl, '?action=help" target="_blank" />
<link rel="search" href="'
. $scripturl . '?action=search" />
<link rel="contents" href="'
, $scripturl, '" />';
// If RSS feeds are enabled, advertise the presence of one.
if (!empty($modSettings['xmlnews_enable']))
echo '
<link rel="alternate" type="application/rss+xml" title="'
, $context['forum_name'], ' - RSS" href="', $scripturl, '?type=rss;action=.xml" />';
// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href="'
, $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=prev" />
<link rel="next" href="'
, $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=next" />';
// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="'
. $scripturl . '?board=' . $context['current_board'] . '.0" />';

// YSHOUT HERE


 
global $boardurl;
echo '
<script src="'
,$boardurl,'/yshout/js/prototype.js" type="text/javascript"></script>
<script src="'
,$boardurl,'/yshout/js/moo.ajax.js" type="text/javascript"></script>
<script src="'
,$boardurl,'/yshout/js/behaviour.js" type="text/javascript"></script>
<script src="'
,$boardurl,'/yshout/js/domFunction.js" type="text/javascript"></script>
<script type="text/javascript">
var myfunc = new domFunction(function()
{
loadChat();
}, { "yshout":"id"});
var board_url = "'
; $boardurlparsed = parse_url($boardurl); echo (isset($boardurlparsed['path'])?$boardurlparsed['path']:""), '";
</script>
<script src="'
,$boardurl,'/yshout/js/yshout.js?May122008" type="text/javascript"></script>
<script type="text/javascript">var shoutFile = "home.txt";</script>
<style type="text/css">
#yshout {
font-size: 10px;
}
#yshout p {
margin: 0 0 0; /* Top Bottom Linespacing */
}
.shout-invalid {
background: #FFFDD1;
}
#yshout fieldset {
border: none;
}
#yshout em {
font-style: normal;
}
#yshout p {
line-height: 1;
margin-top: 0;
}
#yshout {
overflow: hidden;
}
#yshout .shout-timestamp {
font-weight: normal;
color: #000;
}
#yshout .adminlink {
font-size: 6pt;
color: #141414;
}
#forum-name, #shout-text, #shout-button {
font-size: 9px;
margin: 0;
padding: 0;
}
#yshout #forum-name {
color: #666666;
width: 70px;
margin-right: 5px;
}
#yshout #shout-text {
color: #000000;
width: 310px;
margin-right: 5px;
}
#yshout #shout-button {
width: 55px;
}
</style>'
;
// YSHOUT END
 
 
// We'll have to use the cookie to remember the header...
if ($context['user']['is_guest'])
{
$options['collapse_header'] = !empty($_COOKIE['upshrink']);
$options['collapse_header_ic'] = !empty($_COOKIE['upshrinkIC']);
}
// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header = '
, empty($options['collapse_header']) ? 'false' : 'true', ';
function shrinkHeader(mode)
{'
;
// Guests don't have theme options!!
if ($context['user']['is_guest'])
echo '
document.cookie = "upshrink=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "'
, $context['session_id'], '");';
echo '
document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");
document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";
document.getElementById("upshrinkHeader2").style.display = mode ? "none" : "";
current_header = mode;
}
// ]]></script>'
;
// the routine for the info center upshrink
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header_ic = '
, empty($options['collapse_header_ic']) ? 'false' : 'true', ';
function shrinkHeaderIC(mode)
{'
;
if ($context['user']['is_guest'])
echo '
document.cookie = "upshrinkIC=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "'
, $context['session_id'], '");';
echo '
document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");
document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";
current_header_ic = mode;
}
// ]]></script>
'
; // script for shoutbox upshrink
echo ' <script language="JavaScript" type="text/javascript"><!-- // -->
<![CDATA[ var current_header_sb = '
, empty($options['collapse_shoutbox']) ? 'false' : 'true', ';
function shrinkHeaderSB(mode) {'
;
if (
$context['user']['is_guest'])
echo
' document.cookie = "upshrinkSB=" + (mode ? 1 : 0);';
else echo
' smf_setThemeOption("collapse_shoutbox", mode ? 1 : 0, null, "', $context['session_id'], '");';
echo
' document.getElementById("upshrinkSB").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");
document.getElementById("upshrinkSBHeader").style.display = mode ? "none" : "";
current_header_sb = mode;
}
function sbToggle() {
shrinkHeaderSB(!current_header_sb);
}
// ]]></script>
</head>
<body>
<div id="toparea">
<div id="topbox" class="wrapper">

<div id="userarea">'
;

 
if($context['user']['is_logged'])
{
echo $txt['hello_member_ndt'] , ' <strong>' , $context['user']['name'] , '</strong>';

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
echo '&nbsp;&nbsp;[<a href="', $scripturl, '?action=pm">', $context['user']['messages'], '/<strong>', $context['user']['unread_messages'] , '</strong></a> PM]';
// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '[<strong>Maintenace</strong>]';

// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '[<a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] , ' APPROVE</a> ]';
echo '&nbsp;&nbsp;<a href="', $scripturl, '?action=unread">Unread</a> / <a href="', $scripturl, '?action=unreadreplies">Replies</a>';
}
else
echo sprintf($txt['welcome_guest'], $txt['guest_title']);
echo '
</div>
</div>
</div>
<div id="mainarea">
<div id="header" class="wrapper">
<div id="logo">
<a href="'
.$scripturl.'" title=""></a>
</div>
<div id="searcharea">'
;

echo '
<form action="'
, $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
<input class="inputbox" type="text" name="search" value="'
, $txt['search'], '..." onfocus="this.value = \'\';" onblur="if(this.value==\'\') this.value=\'', $txt['search'], '...\';" />';
// 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>
</div>

</div>

<div class="wrapper">
<div id="toolbar-l">
<div id="toolbar-r">
<div id="toolbar">
'
,template_menu(),'
</div>
</div>
</div>
<div id="bodybox">
<div id="bdybox-l">
<div id="bdybox-b">
<div id="bdybox-br">
<div id="bdybox-bl">
<div id="bdybox-t">
<div id="bdybox-tr">
<div id="bdybox-tl">'
;
}
function
template_main_below()
{
global $context, $settings, $options, $scripturl, $txt;
echo '
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>'
;
echo '
</div>'
;
// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '
<div id="bottomarea">
<div id="footer">
<div id="footerarea">
<span class="smalltext">DS-Natural designed by <a href="http://www.dzinerstudio.com" target="_blank"><b>DzinerStudio</b></a><br />
<br />'
, theme_copyright(), '</span>';

// Show the load time?
if ($context['show_load_time'])
echo '
<br /><span class="smalltext">'
, $txt['page_created'], $context['load_time'], $txt['seconds_with'], $context['load_queries'], $txt['queries'], '</span>';
echo '
</div>
</div>
</div>'
;
// The following will be used to let the user know that some AJAX process is running
echo '
<div id="ajax_in_progress" style="display: none;'
, $context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' : '', '">', $txt['ajax_in_progress'], '</div>';
echo
'
</body></html>'
;
}
// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
global $context, $settings, $options;
echo '
<div class="pathway">'
;
// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];
// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
// Show the link, including a URL if it should have one.
echo $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '">' . $tree['name'] . '</a>' : $tree['name'] , '&nbsp;&laquo;&nbsp;';
else
echo $tree['name'];
// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];
}
echo '</div>';
}
// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

// Work out where we currently are.
$current_action = 'home';
if (in_array($context['current_action'], array('admin', 'ban', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers')))
$current_action = 'admin';
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
$current_action = $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action = 'search';
if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';
// Are we using right-to-left orientation?
if ($context['right_to_left'])
{
$first = 'last';
$last = 'first';
}
else
{
$first = 'first';
$last = 'last';
}
// Show the start of the tab section.
echo '
<div id="topmenu">
<ul>'
;

// Show the [home] button.
echo '<li><a' , $current_action=='home' ? ' class="current"' : '' , ' href="', $scripturl, '"><span>' , $txt['home'] , '</span></a></li>';
// Show the [help] button.
echo '<li><a' , $current_action=='help' ? ' class="current"' : '' , ' href="', $scripturl, '?action=help"><span>' , $txt['help'] , '</span></a></li>';
// How about the [search] button?
if ($context['allow_search'])
echo '<li><a' , $current_action=='search' ? ' class="current"' : '' , ' href="', $scripturl, '?action=search"><span>' , $txt['search'] , '</span></a></li>';
// The [calendar]!
if ($context['allow_calendar'])
echo '<li><a' , $current_action=='calendar' ? ' class="current"' : '' , ' href="', $scripturl, '?action=calendar"><span>' , $txt['calendar'] , '</span></a></li>';
// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo '<li><a' , $current_action=='admin' ? ' class="current"' : '' , ' href="', $scripturl, '?action=admin"><span>' , $txt['admin'] , '</span></a></li>';
// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo '<li><a' , $current_action=='profile' ? ' class="current"' : '' , ' href="', $scripturl, '?action=profile"><span>' , $txt['profile'] , '</span></a></li>';
// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo '<li><a' , $current_action=='pm' ? ' class="current"' : '' , ' href="', $scripturl, '?action=pm"><span>' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</span></a></li>';
// the [member] list button
if ($context['allow_memberlist'])
echo '<li><a ' , $current_action=='mlist' ? ' class="current"' : '' , ' href="', $scripturl, '?action=mlist"><span>' , $txt['members_title'] , '</span></a></li>';
// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo '<li><a ' , $current_action=='login' ? ' class="current"' : '' , ' href="', $scripturl, '?action=login"><span>' , $txt['login'] , '</span></a></li>';
// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo '<li><a ' , $current_action=='register' ? ' class="current"' : '' , ' href="', $scripturl, '?action=register"><span>' , $txt['register'] , '</span></a></li>';
// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo '<li><a ' , $current_action=='logout' ? ' class="current"' : '' , 'href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '"><span>' , $txt['logout'] , '</span></a></li>';
echo '
</ul>
</div>'
;
}
// Generate a strip of buttons.
function template_button_strip($button_strip, $direction = 'top', $force_reset = false, $custom_td = '')
{
global $settings, $buttons, $context, $txt, $scripturl;
// Create the buttons...
foreach ($button_strip as $key => $value)
{
if (isset($value['test']) && empty($context[$value['test']]))
{
unset($button_strip[$key]);
continue;
}
elseif (!isset($buttons[$key]) || $force_reset)
$buttons[$key] = '<a href="' . $value['url'] . '" ' .( isset($value['custom']) ? $value['custom'] : '') . '>' . $txt[$value['text']] . '</a>';
$button_strip[$key] = $buttons[$key];
}
if (empty($button_strip))
return '<td>&nbsp;</td>';
echo '
<td class="'
, $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'last' : 'first' , '">&nbsp;</td>
<td class="'
, $direction == 'top' ? 'main' : 'mirror', 'tab_back">', implode(' &nbsp;|&nbsp; ', $button_strip) , '</td>
<td class="'
, $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'first' : 'last' , '">&nbsp;</td>';
}
?>


this can be added where i want to, but i cant shout in it and it makes the theme look very bad then.
// YSHOUT HERE - shoutbox code
      echo '
                     <br /><b>',$txt['yshout_shoutbox'],'</b><br /><br />
                     <div id="yshout">',$txt['yshout_loading'],'<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div>';
      // YSHOUT END - shoutbox code // YSHOUT HERE - shoutbox code
      echo '
                     <br /><b>',$txt['yshout_shoutbox'],'</b><br /><br />
                     <div id="yshout">',$txt['yshout_loading'],'<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div>';
      // YSHOUT END - shoutbox code


thanks

sadee

i want to move shoutbox at end of the page
but its coming At top


www.sadeestyle.com/forum

ionic84

ok i found it:

<div id="toolbar">
',template_menu(),'

</div>
</div>
</div>
';
// YSHOUT HERE - shoutbox code
   global $txt,$context,$boarddir;
   if(allowedTo('yshout_view'))
   {
      echo '<br /><b>',$txt['yshout_shoutbox'],'</b><br /><br />';
      echo '<div id="yshout">';
      include_once($boarddir.'/yshout/yshout.php');
      echo '</div>';
   }
   elseif($context['user']['is_guest'])
      echo $txt['yshout_no_guests'];
   // YSHOUT END - shoutbox code
   echo'
<div id="bodybox">
<div id="bdybox-l">


then it works fine

DBO

yes nneonneo running 1.20

assam_siddibapa

Quote from: nneonneo on July 29, 2008, 11:27:13 PM
@assam_sidibapa: Read that post, and try the suggestion. You'll need to know at least a little HTML to make it look decent.


Can u plz help me out .... just say me where do i put the code in the board index

nneonneo

@ionic84: Are you using SB 1.20? If so, you need to replace the code in the <head> section with updated code.

@sadee: Edit index.template.php, moving the "shoutbox code" down to where you want it.

@mr_fix_it: Then I don't know what's going on :-\

@assam_siddibapa: Like I've said, it depends on the theme! See http://www.simplemachines.org/community/index.php?topic=137508.msg1630197#msg1630197 for an example...
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

assam_siddibapa

Can u do it for me if i put the board index here.
Plz

DBO

if i work it out i will put a post up....thanks anyway nneonneo

MissRancher

Quote from: nneonneo on July 29, 2008, 11:27:13 PM
@MissRancher: Or, your theme has its own Modifications.english.php file, which you need to modify

Hmm I'm still getting the errors, and my theme does not have it's own Modifications.english.php file. I have added the yshout values to all the english or english-utf8 files I could find. Any other thoughts as to why I'm still seeing the errors?

nneonneo

@assam_sidibapa: ok

@MissRancher: Do any other themes have their own Modifications files, or have you installed any other languages? The errors should not be appearing if the language strings are available. Lastly, check to make sure the code didn't all end up on one line, because it tends to do that...
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

assam_siddibapa

I have two themes installed ... i hope both needs to do same modifications

[unplugged]

« Next Edit: Tomorrow at 08:34:45 PM by SunKing »   <---- « someone stole my sig... :o »



Adish - (F.L.A.M.E.R)

Quote from: nneonneo on July 28, 2008, 11:07:49 PM
No, you want to edit the makeShout function itself. As for making it look like a board, well, you have to copy the specific code from BoardIndex.template.php or something to make it look proper (I've gotten the best results copying the code from the Recent Posts box, though)

Please tell me the steps, I have no idea what i should do, I cant even find the sbox code in boardindex.template.php

I suppose you might need index.template.php and boardindex.template.php for it. Please let me know the edits so i dont have to ask you again next time  ;D

Thank you for your help.

Furqon

Quote from: nneonneo on July 29, 2008, 03:10:38 PM
@Furqon: On the front page, too? That shouldn't happen, though it might be something in 2.0 I didn't know about. Try adding " || $context['current_action']=='home'" to the "if" condition.

Hello,

I'm using SMF 2.0 Beta 3 without Tinyportal, just need help to modified this mod to show up in front page only

I already tried this code

// SHOUTBOX HERE
global $txt,$context,$boarddir;
if(allowedTo('yshout_view'))
{
echo '<b>',$txt['yshout_shoutbox'],'</b><br /><br />';
echo '<div id="yshout">';
include_once($boarddir.'/yshout/yshout.php');
echo '</div>';
}
elseif($context['user']['is_guest'])
echo $txt['yshout_no_guests'];
// SHOUTBOX END


But it won't work
perhaps you'll help me to solve this.

Thanks

Advertisement: