Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev
Reply
Thread Tools
  #1  
Old 2nd December 2012, 23:19
robbie's Avatar
robbie robbie is offline
Member
 
Join Date: Nov 2012
United Kingdom
Posts: 6
Default Shoutbox Edit BBcodes
just wondering if its poss to add the bbcodes to edit shoutbox...

this is the edit part of shoutbox

Code:
<body bgcolor=#1b1e25>
  <?php
  echo '<form method=post action=shoutbox.php>';
  echo '<input type=hidden class=btn name=id value='.(int)$res['id'].'>';
  echo '<center><textarea name=text rows=3 id=specialbox>'.htmlspecialchars($row['text']).'</textarea></center>';
  echo '<center><br><input type=submit name=save value=Save class=btn></center>';
  echo '<br><center><font size=3><font color=red><b>The Rules Of Editing ShoutPosts</b><font></center>';
  echo '<br><center><font size=3><font color=white><b>Do Not Edit shouts in a way that will cause the member to be unhappy</b><font></center>';
  echo '<br><center><font size=3><font color=white><b>Make sure that you are not breaching site rules in any way</b><font></center>';
  echo '<br><center><font size=3><font color=white><b>Do Not Let Things Get Out Of Hand... Know When To Stop</b><font></center>';
  echo '</form></body></html>';
  die;
ive added the shoutbox aswell....


thanks
Attached Files
File Type: rar shoutbox.rar (4.0 KB, 55 views)
Reply With Quote
  #2  
Old 2nd December 2012, 23:31
wMan wMan is offline
Banned
 
Join Date: Feb 2008
P2P
Posts: 1,433
Thumbs up
yes it can be done and looked at you shoutbox.php good to see some of my work going about lol



@index add


PHP Code:
  <script language=javascript>
  <!--
  function bbshout(repdeb, repfin) {
  var input = document.forms['shbox'].elements['shbox_text'];
  input.focus();
  if(typeof document.selection != 'undefined') {
  var range = document.selection.createRange();

  var insText = range.text;
  range.text = repdeb + insText + repfin;
  range = document.selection.createRange();
  if (insText.length == 0) {
  range.move('character', -repfin.length);
  } else {
  range.moveStart('character', repdeb.length + insText.length + repfin.length);
  }
  range.select();
  }
  else if(typeof input.selectionStart != 'undefined')
  {
  var start = input.selectionStart;
  var end = input.selectionEnd;
  var insText = input.value.substring(start, end);
  input.value = input.value.substr(0, start) + repdeb + insText + repfin + input.value.substr(end);

  var pos;
  if (insText.length == 0) {
  pos = start + repdeb.length;
  } else {
  pos = start + repdeb.length + insText.length + repfin.length;
  }
  input.selectionStart = pos;
  input.selectionEnd = pos;
  }
  else
  {

  var pos;
  var re = new RegExp('^[0-9]{0,3}$');
  while(!re.test(pos)) {
  pos = prompt("Insertion à la position (0.." + input.value.length + "):", "0");
  }
  if(pos > input.value.length) {
  pos = input.value.length;
  }

  var insText = prompt("Veuillez entrer le texte à formater:");
  input.value = input.value.substr(0, pos) + repdeb + insText + repfin + input.value.substr(pos);
  }
  }
  //-->
  function bbcolor() {
  var colorvalue = document.forms['shbox'].elements['color'].value;
  bbshout("[color="+colorvalue+"]", "[/color]");
  }

  function bbfont() {
  var fontvalue = document.forms['shbox'].elements['font'].value;
  bbshout("[font="+fontvalue+"]", "[/font]");
  }

  function bbsize() {
  var sizevalue = document.forms['shbox'].elements['size'].value;
  bbshout("[size="+sizevalue+"]", "[/size]");
  }

  function bbimg() {
  var imgvalue = document.forms['shbox'].elements['img'].value;
  bbshout("[img="+sizevalue+"]", "[/img]");
  }

  function SmileIT(smile,form,text){
  document.forms[form].elements[text].value = document.forms[form].elements[text].value+" "+smile+" ";
  document.forms[form].elements[text].focus();
  }

  function PopMoreSmiles(form,name) {
  link='/moresmiles.php?form='+form+'&text='+name
  newWin=window.open(link,'moresmile','height=500,width=500,resizable=yes,scrollbars=yes');
  if (window.focus) {newWin.focus()}
  }

  function mySubmit() {
  setTimeout('document.shbox.reset()',100);
  }

  function shout_url(url) {
  document.location.href = url;
  }
  </script>
  <script LANGUAGE="JavaScript">
  function mySubmit() {
  setTimeout('document.shbox.reset()',100);
  }
  </SCRIPT>

  <?

  
function quickbbshout(){
  echo 
"<center><table border=0 cellpadding=0 cellspacing=2><tr>";
  echo 
"<tr>";
  echo 
"<td width=22><a href=\"javascript:bbshout('[marquee]', '[/marquee]')\"><img height=20 src=./pic/bbcode/bbcode_defile.gif border=0 title='Marquee'></a></td>";
  echo 
"<td width=22><a href=\"javascript:bbshout('[blink]', '[/blink]')\"><img height=20 src=./pic/bbcode/bbcode_blink.gif border=0 title='Blink'></a></td>";
  echo 
"<td width=22><a href=\"javascript:bbshout('[center]', '[/center]')\"><img height=20 src=./pic/bbcode/bbcode_center.gif border=0 title='Center'></a></td>";
  echo 
"<td width=22><a href=\"javascript:bbshout('[b]', '[/b]')\"><img height=20 src=./pic/bbcode/bbcode_bold.gif border=0 title='Bold'></a></td>";
  echo 
"<td width=22><a href=\"javascript:bbshout('[i]', '[/i]')\"><img height=20 src=./pic/bbcode/bbcode_italic.gif border=0 title='Italic'></a></td>";
  echo 
"<td width=22><a href=\"javascript:bbshout('[u]', '[/u]')\"><img height=20 src=./pic/bbcode/underline.gif border=0 title='Underline'></a></td>";
  echo 
"<td width=22><a href=\"javascript:bbshout('[url]', '[/url]')\"><img height=20 src=./pic/bbcode/bbcode_url.gif border=0 title='Url'></a></td>";
  echo 
"<td width=22><a href=\"javascript:bbshout('[img]', '[/img]')\"><img height=20 src=./pic/bbcode/bbcode_image.gif border=0 title='Img'></a></td>";
  echo 
"<td>
  <select name='color' size='0.5' onChange=\"javascript:bbcolor()\">
  <option selected='selected'>COLOR</option>
  <option value=skyblue style=color:skyblue>sky blue</option><option value=royalblue style=color:royalblue>royal blue</option><option value=blue style=color:blue>blue</option><option value=darkblue style=color:darkblue>dark-blue</option><option value=orange style=color:orange>orange</option><option value=orangered style=color:orangered>orange-red</option><option value=crimson style=color:crimson>crimson</option><option value=red style=color:red>red</option><option value=firebrick style=color:firebrick>firebrick</option><option value=darkred style=color:darkred>dark red</option><option value=green style=color:green>green</option><option value=limegreen style=color:limegreen>limegreen</option><option value=seagreen style=color:seagreen>sea-green</option><option value=deeppink style=color:deeppink>deeppink</option><option value=tomato style=color:tomato>tomato</option><option value=coral style=color:coral>coral</option><option value=purple style=color:purple>purple</option><option value=indigo style=color:indigo>indigo</option><option value=burlywood style=color:burlywood>burlywood</option><option value=sandybrown style=color:sandybrown>sandy brown</option><option value=sienna style=color:sienna>sienna</option><option value=chocolate style=color:chocolate>chocolate</option><option value=teal style=color:teal>teal</option><option value=silver style=color:silver>silver</option>
  </select></td>"
;
  echo 
"<td>
  <select name='font' size='0.5' onChange=\"javascript:bbfont()\">
  <option selected='selected'>FONT</option>
  <option value=arial>Arial</option><option value=comic sans ms>Comic</option><option value=courier new>Courier New</option><option value=tahoma>Tahoma</option><option value=times new roman>Times New Roman</option><option value=verdana>Verdana</option>
  </select></td>"
;
  echo 
"<td>
  <select name='size' size='0.5' onChange=\"javascript:bbsize()\">
  <option selected='selected'>Size</option>
  <option value=1>1</option><option value=2>2</option><option value=3>3</option><option value=4>4</option><option value=5>5</option><option value=6>6</option><option value=7>7</option>
  </select></td>"
;
  echo 
"</tr></table></center>";
  }
  if (
$CURUSER['show_shout'] === "yes") {
  
?>
  <?begin_frame("<font size=2><b><font size=2 color=#0181FF>Please take <u>ALL</u> support issues to the Forums</b></font>",true);?>


  <center><iframe src='shoutbox.php' width='100%' height='400' align='center' frameborder='0' name='sbox' marginwidth='0' marginheight='0'></iframe><br><br>
  <form action='shoutbox.php' method='get' target='sbox' name='shbox' type="button" onSubmit="mySubmit()">
  <font size='1'><center><b><font color=yellow>Shoutbox Rules: English Only, No Swearing, Personal Attacks, No Outside Links,  No Abuse, No Spamming, Publishing Serials, Cracks, ETC</font><br><b><b></center>
  <p align="center"><b><font color=red>Msg Here: </b></font><input class='btn' type='text' name='shbox_text' size='60'><span style="font-size: 14px; background-color: lime"><input type='submit' style='vertical-align:top' class='btn' value="Send Msg"></span><a href="javascript: PopMoreSmiles('shbox','shbox_text')" type="button" class='btn'><font color=#617053>Smilies</font></a><a href='shoutbox.php' target='sbox' type="button" class='btn'><font color=#617053>Refresh</font></a><?if (get_user_class() >= UC_SHOUT_MODERATOR){ ?><a target='_blank' href='shoutbox_log.php' target='_blank'type="button" class='btn'><font color=#617053>Shout Log</font></a><?}?>
  
  <?
  
if (get_user_class() >= UC_SHOUT_MODERATOR)
  {
  print (
"<h4><center><a class=altlink href=/takedelallsb.php><b>Emptiy Shoutbox</b></a></center></h4>");
  }
  
?>

  <script type="text/javascript">

  //Depending on whether your page supports SSI (.shtml) or PHP (.php),
  //UNCOMMENT the line below your page supports and COMMENT the one it does not:
  //Default is that SSI method is uncommented, and PHP is commented:
  ///----Default has been changed to PHP to suit This code ==Fireknight----//

  //var currenttime = '<!--#config timefmt="%B %d, %Y %H:%M:%S"--><!--#echo var="DATE_LOCAL" -->' //SSI method of getting server date
  var currenttime = '<? print date("F d, Y H:i:s"time())?>' //PHP method of getting server date

  ///////////Stop editting here/////////////////////////////////

  var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
  var serverdate=new Date(currenttime)

  function padlength(what){
  var output=(what.toString().length==1)? "0"+what : what
  return output
  }

  function displaytime(){
  serverdate.setSeconds(serverdate.getSeconds()+1)
  var datestring=montharray[serverdate.getMonth()]+" "+padlength(serverdate.getDate())+", "+serverdate.getFullYear()
  var timestring=padlength(serverdate.getHours())+":"+padlength(serverdate.getMinutes())+":"+padlength(serverdate.getSeconds())
  document.getElementById("servertime").innerHTML=datestring+" "+timestring
  }

  window.onload=function(){
  setInterval("displaytime()", 1000)
  }

  </script>

  <input type='hidden' name='sent' value='yes'><br>
  <?quickbbshout();?>
  <br>
  <center><a href="javascript: SmileIT(':rofl2:','shbox','shbox_text')"><img src=pic/smilies/rofl2.gif border=0></a>
  &nbsp;<a href="javascript: SmileIT(':wave:','shbox','shbox_text')"><img src=pic/smilies/wave.gif border=0></a>
  &nbsp;<a href="javascript: SmileIT(':whistle:','shbox','shbox_text')"><img src=pic/smilies/whistle.gif border=0></a>
  &nbsp;<a href="javascript: SmileIT(';-)','shbox','shbox_text')"><img src=pic/smilies/wink.gif width="20" height="20" border=0></a>
  &nbsp;<a href="javascript: SmileIT(':-P','shbox','shbox_text')"><img src=pic/smilies/tongue.gif width="20" height="20" border=0></a>
  &nbsp;<a href="javascript: SmileIT(':-)','shbox','shbox_text')"><img border=0 src=pic/smilies/smile1.gif></a>
  &nbsp;<a href="javascript: SmileIT(':w00t:','shbox','shbox_text')"><img border=0 src=pic/smilies/w00t.gif></a>
  &nbsp;<a href="javascript: SmileIT(':-D','shbox','shbox_text')"><img border=0 src=pic/smilies/grin.gif></a>
  &nbsp;<a href="javascript: SmileIT(':lol:','shbox','shbox_text')"><img border=0 src=pic/smilies/laugh.gif></a>
  &nbsp;<a href="javascript: SmileIT(':-/','shbox','shbox_text')"><img border=0 src=pic/smilies/confused.gif></a>
  &nbsp;<a href="javascript: SmileIT(':-(','shbox','shbox_text')"><img border=0 src=pic/smilies/sad.gif></a>
  &nbsp;<a href="javascript: SmileIT(':-O','shbox','shbox_text')"><img src=pic/smilies/ohmy.gif border=0></a>
  &nbsp;<a href="javascript: SmileIT('8-)','shbox','shbox_text')"><img src=pic/smilies/cool1.gif width="18" height="18" border=0></a>
  &nbsp;<a href="javascript: SmileIT(':sly:','shbox','shbox_text')"><img src=pic/smilies/sly.gif width="18" height="18" border=0></a>
  &nbsp;<a href="javascript: SmileIT(':greedy:','shbox','shbox_text')"><img src=pic/smilies/greedy.gif width="18" height="18" border=0></a>
  &nbsp;<a href="javascript: SmileIT(':weirdo:','shbox','shbox_text')"><img src=pic/smilies/weirdo.gif width="18" height="18" border=0></a>
  &nbsp;<a href="javascript: SmileIT(':sneaky:','shbox','shbox_text')"><img src=pic/smilies/sneaky.gif width="18" height="18" border=0></a>
  &nbsp;<a href="javascript: SmileIT(':shit:','shbox','shbox_text')"><img src=pic/smilies/shit.gif width="18" height="18" border=0></a>
  &nbsp;<a href="javascript: SmileIT(':?:','shbox','shbox_text')"><img src=pic/smilies/question.gif width="18" height="18" border=0></a>
  &nbsp;<a href="javascript: SmileIT(':!:','shbox','shbox_text')"><img src=pic/smilies/excl.gif width="18" height="18" border=0></a></center>
  </form>
  <?end_frame();?>

And i know what basecode your using too lol and you never get the seedbonus too work
Reply With Quote
  #3  
Old 3rd December 2012, 13:38
robbie's Avatar
robbie robbie is offline
Member
 
Join Date: Nov 2012
United Kingdom
Posts: 6
Default
im refering to the edit part of the shoutbox.php lol not the part of index....
ive got that bit already.... i want to have bbcode in edit shoutbox aswell//

thanks


Ps...And how do you know what source im using, and why wont the seedbonus ever work... when ive got it working perfectly....
Reply With Quote
  #4  
Old 16th January 2013, 13:17
fireknight's Avatar
fireknight fireknight is offline
Administrator
 
Join Date: Aug 2010
Australia
Posts: 173
Default
Not knowing which code you are using for the bbcodes function, I will assume you are using this POST.

You will have to move the functions to global.php so that the shout edit will pick them up.

Then it's just a simple case of adding quickbbshout(); where you want the bbcode to show.

Example
Code:
<body bgcolor=#1b1e25>
<?php   
echo '<form method=post action=shoutbox.php>';   
echo '<input type=hidden class=btn name=id value='.(int)$res['id'].'>';   
echo  '<center><textarea name=text rows=3  id=specialbox>'.htmlspecialchars($row['text']).'</textarea></center>';
quickbbshout();
echo '<center><br><input type=submit name=save value=Save class=btn></center>';   
echo  '<br><center><font size=3><font  color=red><b>The Rules Of Editing  ShoutPosts</b><font></center>';   
echo  '<br><center><font size=3><font  color=white><b>Do Not Edit shouts in a way that will cause the  member to be unhappy</b><font></center>';   echo  '<br><center><font size=3><font  color=white><b>Make sure that you are not breaching site rules  in any way</b><font></center>';   
echo  '<br><center><font size=3><font  color=white><b>Do Not Let Things Get Out Of Hand... Know When  To Stop</b><font></center>';   
echo '</form></body></html>';   die;
As I have said with out knowing which mod you are using, it is hard to answer your question fully.
But this should give you the idea, of what to do.
Reply With Quote
Reply

Tags
bbcodes , edit , shoutbox


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 +2. The time now is 00:13. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.