runnerjp Posted August 16, 2006 Share Posted August 16, 2006 hey all...ok i have this code to retrieve the shouts posted and then its displaed as a marquee[quote]<?php#################################include("shoutbox/config/config.php");#################################mysql_connect($host,$dbuser,$dbpass) or die(mysql_error());// Select the database.mysql_select_db($dbname) or die(mysql_error());$query = "SELECT message, author, eml FROM shoutbox order by id DESC LIMIT 1";$result = mysql_query($query);$marquee = "";while($r=mysql_fetch_array($result)){ $marquee.= $r[message]. '<a href=\"$r[eml]\">'. $r[author]. '</a>'";}echo "<marquee><font size='3'>". $marquee. "</font></marqee>";[/quote]rite but the shout box i have saves the stuff in a textbox...it has instructions to make it mysql but very complex.... anyways is their away to retrieve the posts from the txt file?? Link to comment https://forums.phpfreaks.com/topic/17764-shoutbox/ Share on other sites More sharing options...
448191 Posted August 16, 2006 Share Posted August 16, 2006 [quote author=runnerjp link=topic=104529.msg416968#msg416968 date=1155754168]hey all...ok i have this code to retrieve the shouts posted and then its displaed as a marqueerite but the shout box i have saves the stuff in a textbox...it has instructions to make it mysql but very complex.... anyways is their away to retrieve the posts from the txt file??[/quote]Ok, so you're using someone else's code for storing shouts, but you have no idea how to get the shouts out for display?That's your punishment for using code you don't comprehend. ;DNah, I'll help you out. Just show me a couple of lines of the text file.This is, however a good time to give you my take on using other people's code.My advice is, don't. I could give you plenty of reasons, and others might argue with me (framework?), but I think it's generally only a good idea if you can be sure you understand every line of code in it, and know exactly how it works.That means, when I do write the code for you to display your shouts, you will have to figure out how it works. Code snippets aren't lego blocks. :P Link to comment https://forums.phpfreaks.com/topic/17764-shoutbox/#findComment-75847 Share on other sites More sharing options...
runnerjp Posted August 16, 2006 Author Share Posted August 16, 2006 lol well actually the code was helped m,ade by ppl on here :P gimme a sec to get info u need :D Link to comment https://forums.phpfreaks.com/topic/17764-shoutbox/#findComment-75849 Share on other sites More sharing options...
runnerjp Posted August 16, 2006 Author Share Posted August 16, 2006 ok so what do i need to send you.....thanks soooo much 4 duin this :D:D:D:D Link to comment https://forums.phpfreaks.com/topic/17764-shoutbox/#findComment-75851 Share on other sites More sharing options...
448191 Posted August 16, 2006 Share Posted August 16, 2006 Like I said, I need a couple of lines from the file. Alternatively, show me the code that assembles the string it writes. If you know were that is. ::)[quote]lol well actually the code was [s]helped[/s] [u]made[/u] by ppl on here[/quote]Code snippets aren't lego blocks. Did I mention that? ;) Link to comment https://forums.phpfreaks.com/topic/17764-shoutbox/#findComment-75867 Share on other sites More sharing options...
runnerjp Posted August 16, 2006 Author Share Posted August 16, 2006 hha yer ur point is truelol i dnt know where it is.... any idea where i might find it >??? Link to comment https://forums.phpfreaks.com/topic/17764-shoutbox/#findComment-75868 Share on other sites More sharing options...
448191 Posted August 16, 2006 Share Posted August 16, 2006 Hell, as far as I'm concerned, you 'fell through'. You've got 84 posts but you can't even locate string assembly in a simple shoutbox script?Learn PHP, code snippets REALLY aren't lego blocks. :( Link to comment https://forums.phpfreaks.com/topic/17764-shoutbox/#findComment-75877 Share on other sites More sharing options...
runnerjp Posted August 16, 2006 Author Share Posted August 16, 2006 nooooooooo please i need to do this.... is it the code that is writin instead of the text like this MA%253D%253D%7CMA%253D%253D%7C%7CMQ%253D Link to comment https://forums.phpfreaks.com/topic/17764-shoutbox/#findComment-75883 Share on other sites More sharing options...
runnerjp Posted August 16, 2006 Author Share Posted August 16, 2006 pllleeeaaasssseeeeeeeeee hhhheeelllpppppp Link to comment https://forums.phpfreaks.com/topic/17764-shoutbox/#findComment-75890 Share on other sites More sharing options...
GingerRobot Posted August 16, 2006 Share Posted August 16, 2006 Oh, a) Stop wining, if you want people to do something for you, there is a freelance forum. And b) Help us help you! Post a couple of the lines of sample info from the text file. Link to comment https://forums.phpfreaks.com/topic/17764-shoutbox/#findComment-75894 Share on other sites More sharing options...
runnerjp Posted August 16, 2006 Author Share Posted August 16, 2006 sorry :)here u go[quote]MA%253D%253D%7CMA%253D%253D%7C%7CMQ%253D%253D%7CUm9i%7C%7CMg%253D%253D%7CaHR0cDovL3d3dy5rdWhhYy5jby51aw%253D%253D%7C%7CMw%253D%253D%7CODMuMTAwLjE5My4xNw%253D%253D%7C%7CNA%253D%253D%7CSVwnbGwgZG8gZ3JhZmZpdGkgaWYgeW91IHNpbmcgdG8gbWUgaW4gZnJlbmNo%7C%7CNQ%253D%253D%7CMTE1NTc2MDg0MA%253D%253D [/quote] Link to comment https://forums.phpfreaks.com/topic/17764-shoutbox/#findComment-75896 Share on other sites More sharing options...
GingerRobot Posted August 16, 2006 Share Posted August 16, 2006 Thats a sample line from inside the text file? :|Ok, well lets see the part that writes to the text file. Link to comment https://forums.phpfreaks.com/topic/17764-shoutbox/#findComment-75899 Share on other sites More sharing options...
runnerjp Posted August 16, 2006 Author Share Posted August 16, 2006 ohh ok here is index bit [code]include("./config.php");include("./lang.php");// array_to_string and string_to_array functions// originally by daenders AT yahoo DOT com on php.netfunction array_to_string($array) { $retval = ''; foreach ($array as $index => $value) { $retval .= urlencode(base64_encode($index)) . '|' . urlencode(base64_encode($value)) . '||'; } return urlencode(substr($retval, 0, -2));}function string_to_array($string) { $retval = array(); $string = urldecode($string); $tmp_array = explode('||', $string); foreach ($tmp_array as $tmp_val) { list($index, $value) = explode('|', $tmp_val); $retval[base64_decode(urldecode($index))] = base64_decode(urldecode($value)); } return $retval;}function check_words($string,$banwordz) { for($i=0;$i<sizeof($banwordz);$i++){ $string=eregi_replace($banwordz[$i], "****", $string); } return $string;}function check_ip($bannedipz) { $isokay = true; foreach($bannedipz as $banip) { if ($_SERVER['REMOTE_ADDR'] == $banip) { $isokay = false; } } return $isokay;}function getTagName($text,$cnt){ while(($cnt < strlen($text))&&(eregi("[^a-z0-9]",substr($text,$cnt,1))))$cnt++; $tagNameStart=$cnt; while(($cnt < strlen($text))&&(!eregi("[^a-z0-9]",substr($text,$cnt,1))))$cnt++; return substr($text,$tagNameStart,$cnt-$tagNameStart);}function getTagEnd($text,$cnt){ return strpos($text,">",$cnt);}function closeUnclosedTags($text){ $openedTags=array(); $cnt=0; while(($cnt < strlen($text))&&(true)) { if(substr($text,$cnt,2)=="</") { $tagEnd=getTagEnd($text,$cnt); $tagName=getTagName($text,$cnt); $lastOpenedTag=array_pop($openedTags); if($lastOpenedTag==NULL) { //error: no tag was opened - delete the close tag $text=substr($text,0,$cnt).substr($text,$tagEnd+1); }elseif($lastOpenedTag!=$tagName){ //error: closing unopened tag (possible cross-nesting) - return the original opened tag and delete the close tag array_push($openedTags,$lastOpenedTag); $text=substr($text,0,$cnt).substr($text,$tagEnd+1); }else{ $cnt=$tagEnd+1; } }elseif(substr($text,$cnt,1)=="<"){ $tagEnd=getTagEnd($text,$cnt); $tagName=getTagName($text,$cnt); if(substr($text,$tagEnd-1,1)!="/")array_push($openedTags,$tagName); $cnt=$tagEnd+1; }else{ $cnt++; } } while(count($openedTags)>0)$text.="</".array_pop($openedTags).">"; return $text;}function parse_smileys($string) {$smileylist = array();$i = 0;if ($handle = opendir('./smileys/')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $smileylist[$i] = str_replace(".gif", "", $file); $i++; } } closedir($handle);}foreach ($smileylist as $smileycheck){ $string = str_replace(":".$smileycheck.":", "<img src=\"smileys/".$smileycheck.".gif\" />", $string);}return $string;}[/code] Link to comment https://forums.phpfreaks.com/topic/17764-shoutbox/#findComment-75904 Share on other sites More sharing options...
runnerjp Posted August 17, 2006 Author Share Posted August 17, 2006 ? Link to comment https://forums.phpfreaks.com/topic/17764-shoutbox/#findComment-76141 Share on other sites More sharing options...
GingerRobot Posted August 17, 2006 Share Posted August 17, 2006 I cant actually see any part of the script which writes to a file...perhaps im just blind. Link to comment https://forums.phpfreaks.com/topic/17764-shoutbox/#findComment-76164 Share on other sites More sharing options...
runnerjp Posted August 17, 2006 Author Share Posted August 17, 2006 really i swear it should b their what would an expample little bit of the code be?? Link to comment https://forums.phpfreaks.com/topic/17764-shoutbox/#findComment-76175 Share on other sites More sharing options...
GingerRobot Posted August 17, 2006 Share Posted August 17, 2006 You would be using the fwrite() function. Link to comment https://forums.phpfreaks.com/topic/17764-shoutbox/#findComment-76178 Share on other sites More sharing options...
runnerjp Posted August 17, 2006 Author Share Posted August 17, 2006 i found it but 4 sum reason it wnt let me post it on here so i slapped it on website [url=http://www.runnerselite.com/phpfreaks.html]www.runnerselite.com/phpfreaks.html[/url] Link to comment https://forums.phpfreaks.com/topic/17764-shoutbox/#findComment-76196 Share on other sites More sharing options...
runnerjp Posted August 17, 2006 Author Share Posted August 17, 2006 is it any help? Link to comment https://forums.phpfreaks.com/topic/17764-shoutbox/#findComment-76245 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.