Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions

Reply
 
Thread Tools Display Modes
  #11  
Old 04-08-2005, 10:54 PM
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Posts: 3,972
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I cannot help you until I know what exactly do you want to see as a result.
Reply With Quote
  #12  
Old 04-08-2005, 11:02 PM
Lizard King Lizard King is offline
 
Join Date: Jan 2005
Location: Mersin
Posts: 907
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have a shoutbox module for vbadvanced Cmps. The module is really simple. It only uses 1 php file and 1 template.
Here is the php file :
Code:
<?php 

###########################################################################
##  MAJESTIC FORUM SHOUTBOX
###########################################################################

###########################################################################
##  REQUIRE BACK-END
###########################################################################

      require_once('./global.php');

	function check($var,$link) 
	{
	$var = trim($var);
	if(empty($var)) 
	{
	header("Location: $link");
	}
	}
	
	function swear() 
	{
	global $comment;
	$swears["++++"] = "++++";
	$swears["++++ing"] = "++++ing";
	$swears["++++"] = "++++";
	$swears["+++++"] = "+++++";
	while(list($text,$image) = each($swears)) 
	{
	$comment = str_replace("$text","$image","$comment");
	}
	return $comment;
	}

	function replace_text_smiley() {
	global $comment;
	$faces["text smiley here"] = "img tag to image smile here";
	$faces[":lol:"] = "<img src=\"http://forum.ayyas.com/images/smilies/cool.gif \" alt=\"Cool\">";
	while(list($text,$image) = each($faces))  {
	$comment = str_replace("$text","$image","$comment");
	}
	return $comment;
	}

###########################################################################
##  CONDITION ONE
###########################################################################
	
            $is = "view";
            if(isset($setting) && !empty($setting) && $setting == "save") {
	
###########################################################################
##  HEAD INFO
###########################################################################

            $back = $HTTP_REFERER;

###########################################################################
##  CHECK DO
###########################################################################

            if($is == "ref") {
            header("Location: shoutbox.php");
            }

###########################################################################
##  CHECK SHOUTBOX STOP NON REGISTERED POSTING
###########################################################################



            check($name,$back);
            check($comment,$back);
            if($bbuserinfo[username]!=$name || $bbuserinfo[userid]==1) 
            {

            ?>
            <font face="Verdana" size="1">
            <?echo('Vur Kac a yazabilmeniz icin kayit olmaniz gerekiyor.');?>
            </font>
            <?
            exit;
            }
	
###########################################################################
##  SAVES SHOUTBOX
###########################################################################	

            $user=$bbuserinfo[userid];
            if(!mysql_query("INSERT INTO adv_shoutbox (name,comment,postuserid) VALUES           ('$name','$comment','$user')")) {
            $url = 'shoutbox.php?is=save';
            header("Location: $url");
		
            } else {

###########################################################################
##  LIMIT SHOUTS TO STOP IT FILLING DATABASE [$maxi - 100] <--- CHANGE THIS TO YOUR LIMIT
###########################################################################	
		
            $res = mysql_query("SELECT max(id) FROM adv_shoutbox"); 
            $maxi = mysql_result($res, 0); 
            mysql_query("DELETE FROM adv_shoutbox WHERE id < ($maxi - 200)"); 
            header("Location: shoutbox.php");
            }
            }

            if(empty($setting) || $setting == "view") {

###########################################################################
##  DISPLAY SHOUTS FROM TABLE
###########################################################################

            $result = mysql_query("SELECT * FROM adv_shoutbox ORDER BY id DESC LIMIT 100") or die (mysql_error());
            $num_res = mysql_num_rows($result);
            if($num_res == "0") {
            echo 'There are no shouts yet.';
            ?>

            <form action="shoutbox.php" method="post">
            <input type="hidden" name="setting" value="save">
            <input type="text" name="name" value="name">
            <br /><input type="text" name="comment" value="comment">
            <br /><input type="submit" value="Shout"></form>

            <?

            } else {

            while ($get = mysql_fetch_row($result)) {
            $name = $get[1];
            $comment = $get[2];
            $postuserid = $get[3];
            $name = strip_tags($name);
            $comments = strip_tags($comments);
            $comment = nl2br($comment);
            replace_text_smiley();
            swear();


###########################################################################
##  SET YOUR OWN COLOURS HERE
###########################################################################
			
			?>
			<body bgcolor="#060606" text="#999999" link="#ff0000" alink="#ff0000" vlink="#ff0000">
            <font face="verdana" size="1"><a href="member.php?u=<? echo "$postuserid"; ?>" target="blank">
            <b><? echo "$name"; ?></b></a><br><? echo "$comment"; ?><br><br></font></body>
			
            <?
            }
            }
            }

###########################################################################
##  CONDITION THREE BAN ERROR
###########################################################################	

	if($is == "ban") {
	echo 'You are banned from the shoutbox. So just leave now.';
	exit;
	}

###########################################################################
##  CONDITION FOUR ERROR ON SHOUT
###########################################################################

           if($is == "save") {
           echo 'There was an error in saving your shoutbox.';
           exit;
           }

###########################################################################
##  MAJESTIC FORUM SHOUTBOX
###########################################################################

?>
and the template it is using is :

Code:
<!-- Shoutbox -->

<script type="text/javascript">
var timer_id;
function scroll_iframe(frm,inc,dir) {
  if (timer_id) clearTimeout(timer_id);
  if (window.frames[frm]) {
    if (dir == "v") window.frames[frm].scrollBy(0, inc);
    else window.frames[frm].scrollBy(inc, 0);
    timer_id = setTimeout("scroll_iframe('" + frm + "'," + inc + ",'" + dir + "')", 20);
  }
}
function stopScroll() { if (timer_id) clearTimeout(timer_id); }
</script>

<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder"width="100%">
<tr><td class="tcat"><span class="smallfont"><strong>$vba_options[portal_blockbullet] $mods[title]</strong></span>
<a href="javascript:;" onmouseover="scroll_iframe('shoutbox', -4, 'v'); window.status='Hover here to scroll up.'; return true" onmouseout="stopScroll(); window.status=''; return true"><img src="http://forum.ayyas.com/images/tri-up.gif" valign="top" align="right" width="12" height="12" alt="Yukarı" border="0"></a></td></tr>

<tr><td class="alt1"><span class="smallfont">
<DIV ID=oDiv STYLE="width: 158px; height: 254px; overflow: hidden;">
<iframe class="alt1" marginwidth="2" marginheight="2" name="shoutbox" noresize scrolling="no" align="middle" frameborder="0" height="250" width="100%" src="forum/shoutbox.php" id="shoutbox"></iframe></DIV>
<form action="forum/shoutbox.php" method="post" target="shoutbox">
<input type="hidden" name="setting" value="save" />
<input type="hidden" name="name" value="$bbuserinfo[username]" size="20" />
<input type="text" name="comment" value="eşeğim ben" size="20" maxlength="100" /><br>
<input class="button" type="submit" value="Bağır ?ağır" /></form></span>
<a href="javascript:;" onmouseover="scroll_iframe('shoutbox', 4, 'v'); window.status='Hover here to scroll down.'; return true" onmouseout="stopScroll(); window.status=''; return true"><img src="//forum.ayyas.com/images/tri-dn.gif" valign="top" align="right" width="12" height="12" alt="Aşağı" border="0"></a></td></tr></table><br />

<!-- Shoutbox -->
You can see it here : www.ayyas.com it matches the style cause i can edit it from the php file but i have other styles and there is no way i can get it working.
check another style to see : http://www.ayyas.com/?styleid=39
Reply With Quote
  #13  
Old 04-09-2005, 12:57 AM
why-not why-not is offline
 
Join Date: Feb 2004
Posts: 218
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi


You are calling a include on './global.php'

So you have all your style var(s) ready to be accessed! I don't know what CSS style var(s) you want to use, but you can decide by just doing this!

To see what colors you want to use....

PUT THIS IN YOUR SCRIPT!

Code:
print_r ( $stylevar );
That will print an array like this! (example only contains a few elements of the array)

Code:
Array
(
    [body_fgcolor] => #2d24c6
    [page_bgcolor] => #ffffff
    [page_fgcolor] => #B9B9B9
    [tborder_bgcolor] => #7a89ea
    [tborder_fgcolor] => #ffffff
    [tcat_bgcolor] => #7a89ea
    [tcat_fgcolor] => #f9f95b
    [thead_bgcolor] => #fafa86
    [thead_fgcolor] => #372fd9
    [tfoot_bgcolor] => #F9F9F9
    [tfoot_fgcolor] => #372fd9
    [alt1_bgcolor] => #ffffff
    [alt1_fgcolor] => #000000
    [alt2_bgcolor] => #ffffff
    [alt2_fgcolor] => #000000
    [wysiwyg_bgcolor] => #ffffff
    [wysiwyg_fgcolor] => #000000
    [smallfont_fgcolor] => #000000
    [time_fgcolor] => #000000
    [navbar_fgcolor] => #000000
    [highlight_fgcolor] => #FF0033
    [fjsel_bgcolor] => #ffffff
    [fjsel_fgcolor] => #655de1
    [fjdpth0_bgcolor] => #f7f7f7
    [fjdpth0_fgcolor] => #000000
    [panel_bgcolor] => #ffffff
    [panel_fgcolor] => #000000
    [panelsurround_bgcolor] => #fafa86
    [panelsurround_fgcolor] => #000000
    [legend_fgcolor] => #372fd9
    [vbmenu_control_bgcolor] => #fafa86
    [vbmenu_control_fgcolor] => #655de1
    [vbmenu_popup_bgcolor] => #ffffff
    [vbmenu_popup_fgcolor] => #655de1
    [vbmenu_option_bgcolor] => #fafa86
    [vbmenu_option_fgcolor] => #655de1
    [vbmenu_hilite_bgcolor] => #ffffff
    [vbmenu_hilite_fgcolor] => #655de1
)

Then just select the style var(s) you want to use... (remember to remove [print_r ( $stylevar );] after getting the array that you will use as your guide!)

example....

Code:
 ##################################################  #########################
##  SET YOUR OWN COLOURS HERE
##################################################  #########################
   
			?>
			<body bgcolor="<?=$stylevar['thead_bgcolor'];?>" text="<?=$stylevar['thead_fgcolor'];?>" link="<?=$stylevar['thead_fgcolor'];?>" alink="<?=$stylevar['tfoot_fgcolor'];?>" vlink="<?=$stylevar['thead_fgcolor'];?>">
			<font face="verdana" size="1"><a href="member.php?u=<? echo "$postuserid"; ?>" target="blank">
			<b><? echo "$name"; ?></b></a><br><? echo "$comment"; ?><br><br></font></body>
   
			<?
			}



Sonia
Reply With Quote
  #14  
Old 04-09-2005, 01:24 AM
Lizard King Lizard King is offline
 
Join Date: Jan 2005
Location: Mersin
Posts: 907
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Sonia Finally I get this working
Reply With Quote
Reply

Thread Tools
Display Modes

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 11:03 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.03819 seconds
  • Memory Usage 2,202KB
  • 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
  • (5)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete