View Single Post
  #201  
Old 11-27-2004, 03:51 PM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mooecow
he just took the code im guessing and went about putting it in the FORUMHOME template and then took the redirection and put it in the head area
you have to put the redirection in the php as per intructions below (last)

This code below above the line towards the end in forum/index.php

// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTA HERE... ###

PHP Code:
    $shouts $DB_site->query("
        SELECT s.*, u.username
        FROM " 
TABLE_PREFIX "shout s
        LEFT JOIN " 
TABLE_PREFIX "user u ON (u.userid = s.userid)
        ORDER BY dateline " 
$vboptions['shoutframeorder'] . ", shoutid " $vboptions['shoutframeorder'] . " LIMIT " $vboptions['shoutframeamount'] . "
    "
);
    while (
$shout $DB_site->fetch_array($shouts))
    {
        
$shout['date'] = vbdate($vboptions['dateformat'], $shout['dateline']);
        
$shout['time'] = vbdate($vboptions['timeformat'], $shout['dateline']);
        
$shout['pagetext'] = parse_bbcode($shout['pagetext'], 'shoutbox');

        if (
$shout['userid'] == 0)
        {
            
$shout['username'] = "<i>" $vbpharse['guest'] . "</i>";
        }

        if (
substr(strtolower($shout['pagetext']), 03) == "/me")
        {
            
$shout['pagetext'] = str_replace("/me """$shout['pagetext']);
            eval(
'$shoutbits .= "' fetch_template('shoutbox_main_message_me') . '";');
        }
        else
        {
            eval(
'$shoutbits .= "' fetch_template('shoutbox_main_message') . '";');
        }
    } 
place this in forumhome before </head>


PHP Code:
<script language="javascript">
<!--
function 
validate(theform)
{
    if (
theform.message.value == "")
    {
        
alert('$vbphrase[you_must_enter_a_shout]');
        return 
false;
    }
    else
    {
        return 
true;
    }
}
//-->
</script

replace the iframe code in forumhome (below $navbar or where you have it) with:

PHP Code:
<!-- shoutbox -->
<
table class="tborder" cellpadding="$stylevar[cellpadding]cellspacing="$stylevar[cellspacing]border="0" width="$stylevar[tablewidth]align="center">
<
thead>
    <
tr>
        <
td class="tcat" colspan="2">
            <
a style="float:$stylevar[right]href="#top" onclick="return toggle_collapse('forumhome_shoutbox')"><img id="collapseimg_forumhome_shoutbox" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_forumhome_shoutbox].gif" alt="" border="0" /></a>
            <if 
condition="$bbuserinfo[userid] > 0"> <a href="shoutbox.php?$session[sessionurl]"></if>Short Public Messages<if condition="$bbuserinfo[userid] > 0"> </a></if> <if condition="$bbuserinfo[userid] > 0"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<form action="shoutbox.php" method="post" onsubmit="return validate(this);" name="shoutform">
<
input type="hidden" name="s" value="$session[sessionhash]/>
<
input type="hidden" name="do" value="insert" />
<
input type="text" style="background-color:#DBDBDB;width:80;" name="message" id="message" value="" size="60" />
<
input style="background-color:#DBDBDB;border:1px solid color:#C0C0C0;height:21px;"
type="submit" value="$vbphrase[shout]class="button" />
</
form> </if></td>
    </
tr>
</
thead>
<
tbody id="collapseobj_forumhome_shoutbox" style="$vbcollapse[collapseobj_forumhome_shoutbox]">
    <
tr>
        <
td class="alt1" width="100%">

        
$shoutbits
        
</td>
    </
tr>
</
tbody>
</
table>
<!-- 
end shoutbox --> 
replace your shoutbox_main_message template with:

PHP Code:
<div class="smallfont">[$shout[date] <span class="time">$shout[time]</span>] <strong>$shout[username]:</strong>-
                    
$shout[pagetext]</div
I got it set in admincp to display only one shout. If you want to display more, place:

<div style="height:30px; width:100%; overflow:auto;"> in forumfome shoutbox code before $shoutbits and that will add a scrollbar. And then goodbye iframe.


And don't forget in shoutbox.php to replace the redirection.

PHP Code:
    // insert into the database
    
$DB_site->query("INSERT INTO " TABLE_PREFIX "shout
        (userid, dateline, pagetext)
    VALUES
        (
$bbuserinfo[userid], " TIMENOW ", '" addslashes($pagetext) . "')
    "
);
    
$shoutid $DB_site->insert_id();

    
header("Location: http://yoursite.com/forums");

    exit; 
The same thing can be done with homepage, by simply inserting the code in there.


And the other guy wants to make people pay for this????
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01538 seconds
  • Memory Usage 1,863KB
  • 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
  • (5)bbcode_php
  • (1)bbcode_quote
  • (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