Jump to content

marksie1988

Members
  • Posts

    225
  • Joined

  • Last visited

Everything posted by marksie1988

  1. Hi, im trying to find some script that i can click on a link and it will open up some information below it which is pulled from a mysql table but each link needs to have a different query for the table to get the correct data. also i want the information to go directly below the link. would it be posible to do this with one mysql query as the only way ive been able to do it is with a query copied and pasted lots of times. is it possible to do like a variable link e.g. in php you would have the link, index.php?category="WEBSITES" and then you would call category in the mysql query. i need the same in javascript :S if you understand me Thanks
  2. ok i have been looking around and have found out that i need to use javascript to do this. as i know nothing about javascript i was wondering if anyone has a script like the one used within smf that will allow me to add bb at the click of an image? i tried to use the same code as used on smf but couldnt get it to function and thought i had probably missed something out. if someone could help i would be greatfull
  3. i keep on getting the following on links on my site i dont know why it is doing this as i have a site with nearly exactly the same setup and it doesnt do this it adds the below to some links but not all and is very random. ?PHPSESSID=e14aa85eddc97521a84916cc21266131
  4. hi, i have a bbcode that is implemented on a tutorial system that i have in place, but i would like to add a table that users can click on an image and the tags are then unserted the same way as they are here. i understand that this needs to be done with javascript and i havent got much javascript knowledge so i could do with some help :S the bbcode i am using is here <? function bbcode ($str) { $str = htmlentities($str); $simple_search = array( //added line break '/\[br\]/is', '/\[b\](.*?)\[\/b\]/is', '/\[i\](.*?)\[\/i\]/is', '/\[u\](.*?)\[\/u\]/is', '/\[url\=(.*?)\](.*?)\[\/url\]/is', '/\[url\](.*?)\[\/url\]/is', '/\[align\=(left|center|right)\](.*?)\[\/align\]/is', '/\[img\](.*?)\[\/img\]/is', '/\[mail\=(.*?)\](.*?)\[\/mail\]/is', '/\[mail\](.*?)\[\/mail\]/is', '/\[font\=(.*?)\](.*?)\[\/font\]/is', '/\[size\=(.*?)\](.*?)\[\/size\]/is', '/\[color\=(.*?)\](.*?)\[\/color\]/is', //added textarea for code presentation '/\[codearea\](.*?)\[\/codearea\]/is', //added pre class for code presentation '/\[code\](.*?)\[\/code\]/is', //added paragraph '/\[p\](.*?)\[\/p\]/is', '/\:\)/is', '/\:\(/is', ); $simple_replace = array( //added line break '<br />', '<strong>$1</strong>', '<em>$1</em>', '<u>$1</u>', // added nofollow to prevent spam '<a href="$1" rel="nofollow" title="$2 - $1">$2</a>', '<a href="$1" rel="nofollow" title="$1">$1</a>', '<div style="text-align: $1;">$2</div>', //added alt attribute for validation '<img src="$1" alt="" />', '<a href="mailto:$1">$2</a>', '<a href="mailto:$1">$1</a>', '<span style="font-family: $1;">$2</span>', '<span style="font-size: $1;">$2</span>', '<span style="color: $1;">$2</span>', //added textarea for code presentation '<textarea class="code_container" rows="30" cols="70">$1</textarea>', //added pre class for code presentation '<pre class="code">$1</pre>', //added paragraph '<p>$1</p>', '<img src="../../images/smilies/smile2.gif">', '<img src="../../images/smilies/sad.gif">', ); // Do simple BBCode's $str = preg_replace ($simple_search, $simple_replace, $str); // Do <blockquote> BBCode $str = bbcode_quote ($str); return $str; } function bbcode_quote ($str) { //added div and class for quotes $open = '<blockquote><div class="quote">'; $close = '</div></blockquote>'; // How often is the open tag? preg_match_all ('/\[quote\]/i', $str, $matches); $opentags = count($matches['0']); // How often is the close tag? preg_match_all ('/\[\/quote\]/i', $str, $matches); $closetags = count($matches['0']); // Check how many tags have been unclosed // And add the unclosing tag at the end of the message $unclosed = $opentags - $closetags; for ($i = 0; $i < $unclosed; $i++) { $str .= '</div></blockquote>'; } // Do replacement $str = str_replace ('[' . 'quote]', $open, $str); $str = str_replace ('[/' . 'quote]', $close, $str); return $str; } ?> Thanks Steve
  5. dont suppose anyone has an example of what i would do i dont quite understand how to do the above would i use something similar to this? if i changed this to fit my tables it should group by the category? SELECT student.student_name,COUNT(*) -> FROM student,course -> WHERE student.student_id=course.student_id -> GROUP BY student_name;
  6. Hi, i have created a forum as i dont want all of the functionality that smf etc has on it i wanted it to be very basic and simple. what is happening is that the code seems to run the while statment 3 times this is what it is showing here is my code may be something very simple that im just missing <?php include("../login/include/session.php"); include("../inc/header.php"); include("../inc/bbcode.php"); ?> <h2>Forum</h2> <?php $cat="SELECT * FROM forum_boards,forum_category";//select the info from the category table $cat2=mysql_query($cat) or die("Could not get threads"); $color1 = "#000000"; $color2 = "#999999"; $row_count = 0; while($cat3=mysql_fetch_array($cat2)) { $cat1=$cat3['category']; //display the category as a header print "<table class='maintable'>"; print "<h3>$cat1</h3>"; $getthreads="SELECT * from forum_boards WHERE category = '$cat1'";//select the boards from the table $getthreads2=mysql_query($getthreads) or die("Could not get threads123"); while($getthreads3=mysql_fetch_array($getthreads2)){ $getthreads3[title]=strip_tags($getthreads3[title]); $boardid=strip_tags($getthreads3[boardid]); $totaltopics = mysql_num_rows(mysql_query("SELECT * FROM forum_posts WHERE boardid='$boardid' AND parentid='0'")); $totalposts = mysql_num_rows(mysql_query("SELECT * FROM forum_posts WHERE boardid='$boardid'")); $row_color = ($row_count % 2) ? $color1 : $color2; print "<tr class='mainrow' bgcolor='$row_color'><td width='40%' ><A href='boards.php?bid=$getthreads3[boardid]'>$getthreads3[title]</a></td><td>Topics: $totaltopics<br /> Posts: $totalposts</td></tr>";//display the boards $row_count++; } } print "</table>"; include('../inc/footer.php'); ?>
  7. tried this but nothing gets written to the database i did it the same as in your tutorial aswell
  8. So would something like the following work? and would this be able to post the information for all users to see or just the bot? or would i need to write the information into a database and then display this information? <?php function agent($bot) { $useragent = $_SERVER['HTTP_USER_AGENT']; return strstr($useragent,$bot); } if(agent("WISENutbot") !== FALSE) { echo "Looksmart Bot"; } else if(agent("Googlebot") !== FALSE) { echo "Google Bot"; } else { echo ""; } ?>
  9. yea if i find anything i will let you know at the moment im seeing if it is possible to rip the mod appart from smf and use bits of that but i dont reali know where to start :S
  10. Is it possible to add to my page a bit that basically says when a spider is on my website, i have seen this in smf and wondered if it is easy to do for a normal website? and does anyone know of a tut? Thanks
  11. each board has a category here are the tables CREATE TABLE `forum_boards` ( `boardid` bigint(20) NOT NULL auto_increment, `category` varchar(50) NOT NULL, `title` varchar(255) NOT NULL default '', `description` mediumtext NOT NULL, PRIMARY KEY (`boardid`) ) CREATE TABLE `forum_category` ( `catid` bigint(20) NOT NULL auto_increment, `category` varchar(50) NOT NULL, PRIMARY KEY (`catid`) ) CREATE TABLE `forum_posts` ( `postid` bigint(20) NOT NULL auto_increment, `author` varchar(255) NOT NULL default '', `title` varchar(255) NOT NULL default '', `post` mediumtext NOT NULL, `showtime` varchar(255) NOT NULL default '', `realtime` bigint(20) NOT NULL default '0', `lastposter` varchar(255) NOT NULL default '', `numreplies` bigint(20) NOT NULL default '0', `parentid` bigint(20) NOT NULL default '0', `boardid` bigint(20) NOT NULL default '0', `lastrepliedto` bigint(20) NOT NULL default '0', PRIMARY KEY (`postid`) )
  12. if i join the tables thought wouldnt i need an if statement for each category ?
  13. i am trying to create a forum system on my website, i have created the forum but i want to create categories that multiple boards can go in a bit like on here, but i dont know how i can basically say the following: query category database display category if category = 1 then display all boards with category 1. here is the code i tried i will put comments into it to show you whats what. $cat="SELECT * from forum_category";//select the info from the category table $cat2=mysql_query($cat) or die("Could not get threads"); while($cat3=mysql_fetch_array($cat2)) { $cat1=$cat3['category']; print "<h3>$cat1</h3>";//display the category as a header print "<table class='maintable'>"; $getthreads="SELECT * from forum_boards WHERE category='$cat1'";//select the boards from the table $getthreads2=mysql_query($getthreads) or die("Could not get threads"); while($getthreads3=mysql_fetch_array($getthreads2)) { $getthreads3[title]=strip_tags($getthreads3[title]); print "<tr class='mainrow'><td><A href='boards.blc?bid=$getthreads3[boardid]'>$getthreads3[title]</a></td></tr>";//display the boards } } basically the board that has the same category should be displayed under that category area
  14. thanks for that one it works perfectly thanks again steve
  15. monkeytooth yours is the closest to what i need but unfortunatly the plaintext tag never closes i looked it up and doesnt look like you can close that tag so i need one along those lines. i dont know how smf and other forums do it but surley doing it the same way as them would be easiest
  16. but if i do that wont it stop all of the bb code from working ?
  17. look here http://www.blconline.co.uk/tutorials/tutorial.blc?id=4 if you look inside the first code box all of the bbcode tags are showing as bbcode when i dont want them to i want anything inside the code tags to simply show as text nothing else
  18. that doesnt work still shows the str_replace smilies in it.
  19. ok that worked thanks just need the answer to how i can stop the code from displaying any chars as bbcode i want anything inside them tage to do the same as they do on this forum
  20. i have created a bbcode for my website and here it is <? function bbcode($txt){ $txt = preg_replace_callback('#\[php\](.+?)\[/php\]#msi',create_function('$matches', 'return highlight_string($matches[1], true);'), $txt); $txt = preg_replace('#\[b\](.+?)\[/b\]#msi', '<b>\\1</b>', $txt); $txt = preg_replace('#\[b\](.+?)\[/b\]#msi', '<b>\\1</b>', $txt); $txt = preg_replace('#\[i\](.+?)\[/i\]#msi', '<i>\\1</i>', $txt); $txt = preg_replace('#\[i\](.+?)\[/i\]#msi', '<i>\\1</i>', $txt); $txt = preg_replace('#\[u\](.+?)\[/u\]#msi', '<u>\\1</u>', $txt); $txt = preg_replace('#\[u\](.+?)\[/u\]#msi', '<u>\\1</u>', $txt); $txt = preg_replace('#\[s\](.+?)\[/s\]#msi', '<s>\\1</s>', $txt); $txt = preg_replace('#\[s\](.+?)\[/s\]#msi', '<s>\\1</s>', $txt); //email $txt = preg_replace('#\[email\](.+?)\[/email\]#msi', '<a href="mailto:\1">\\1</a>', $txt); //code $txt = preg_replace('#\[code\](.+?)\[/code\]#msi', '<div style="border: solid 1px orange; padding:20px; margin: 20px">\\1</div>', $txt); //images $txt = preg_replace('#\[img\](.+?)\[/img\]#msi', '<img src="\\1" border=0>', $txt); //smilies $txt = str_replace('','<img src="../../images/smilies/smile2.gif">',$txt); $txt = str_replace('','<img src="../../images/smilies/sad.gif">',$txt); $txt = str_replace(':$','<img src="../../images/smilies/confoosed.gif">',$txt); $txt = str_replace(':teeth:','<img src="../../images/smilies/bigteeth.gif">',$txt); $txt = str_replace(':cooldude:','<img src="../../images/smilies/cooldude.gif">',$txt); $txt = str_replace(':cglasses:','<img src="../../images/smilies/coolglasses.gif">',$txt); $txt = str_replace('3:>','<img src="../../images/smilies/devil.gif">',$txt); $txt = str_replace('','<img src="../../images/smilies/embaressed.gif">',$txt); $txt = str_replace('','<img src="../../images/smilies/geek.gif">',$txt); $txt = str_replace(':evillook:','<img src="../../images/smilies/grr.gif">',$txt); $txt = str_replace(':hoh:','<img src="../../images/smilies/oh.gif">',$txt); $txt = str_replace('','<img src="../../images/smilies/pirate.gif">',$txt); $txt = str_replace(':robot:','<img src="../../images/smilies/robot.gif">',$txt); $txt = str_replace(':robot:','<img src="../../images/smilies/skull.gif">',$txt); $txt = str_replace(':]','<img src="../../images/smilies/smile.gif">',$txt); $txt = str_replace(':|','<img src="../../images/smilies/straight.gif">',$txt); $txt = str_replace(':stumped:','<img src="../../images/smilies/thinking.gif">',$txt); $txt = str_replace('','<img src="../../images/smilies/tongue.gif">',$txt); $txt = str_replace(':vamp:','<img src="../../images/smilies/vampire.gif">',$txt); $txt = str_replace(':7','<img src="../../images/smilies/vface.gif">',$txt); $txt = str_replace(':cat:','<img src="../../images/smilies/wisky.gif">',$txt); $txt = str_replace('','<img src="../../images/smilies/winky.gif">',$txt); return $txt; } ?> the problem im having is that i dont know how to set it so that when someone has a new line in the textarea that it adds a <br /> also when i use the code box it still executes everything within it as if it is bbcode or scripts. i dont know how to stop this from happening anyone know ? Thanks Steve
  21. so when you deleted every thing in the field it worked? i just tried and no it doesnt! i can update the fields with new data but cannot leave the field BLANK
  22. i have a form that users can edit their profile with and when i delete whatever in in a field to nothing the mysql table isn't updated any ideas? you can see for yourself here http://www.blconline.co.uk Username: demo123 Password: demo123 go to edit profile under the header and test if you need my code then please just ask sorry if this is in wrong room wasnt sure if it was php or mysql
  23. ok i have now hit the problem on ff2 so must be part of my code but what could it be? this is my header <head> <link rel="shortcut icon" href="http://www.blacklimecomputers.co.uk/favicon.ico" /> <meta name="verify-v1" content="Uf0Su4UuSc5KKL1BQMOXOH1WzU6HroaKSIB00wzDS5o=" /> <meta name="verify-v1" content="msveLhdpUiMyZJwpW/9JdXyJnIymPb5k/d2duhVyBdg=" /> <meta name="description" content="blacklime computers" /> <meta name="robots" content="index,follow" /> <meta name="keywords" content="marksie, place, web, design, branding, development, copyright, steve, marks, black, lime, blacklime, computers, comp" /> <title>blacklime computers - v<?php echo $vn ?></title> <link rel='stylesheet' href='/styles/default.css'> <script language='javascript' type='text/javascript' src='../../styles.js'></script> <script type="text/javascript"><!-- function sf(){document.login.user.focus();} // --> </script> <SCRIPT type="text/javascript"> <!-- function popup(mylink, windowname) { if (! window.focus)return true; var href; if (typeof(mylink) == 'string') href=mylink; else href=mylink.href; window.open(href, windowname, 'width=450,height=600,scrollbars=yes'); return false; } //--> </SCRIPT> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function NewWindow(mypage, myname, w, h, scroll) { var winl = 100; var wint = 50; winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable' win = window.open(mypage, myname, winprops) if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); } } // End --> </script> </head>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.