Jump to content

ChemicalBliss

Members
  • Posts

    719
  • Joined

  • Last visited

    Never

Everything posted by ChemicalBliss

  1. I completely understand what your saying, but there are a few i've seen that can be helped, that are less than a week old. at least we could say - provide more info . Would help you gain an even bigger community since people that post legitimate questions that aren't answered feel neglected compared to the rest of the community. But it's only a suggestion. -CB-
  2. Hmm, that code should run fine and register globals shouldn't affect it. Try some debugging; do this before the switch : print_r($_GET); print_r($_POST); try the header() function before the switch to see if the header function actually works at all. Any other ways you can think of debugging try also and give us your results. -CB-
  3. These are called "GET Requests". To use them here is a simple template: <?php // isset() = check if a variable is set (isset). $_GET is an assosciation array (names of the variables with the values). if(!isset($_GET['action'])){ echo("Page 1 <br />"); echo("<a href='?action=page2'>Go to page 2</a>"); }elseif($_GET['action'] == "page2"){ echo("Page 1"); }else{ echo("Page doesnt exist"); } ?> Hope this helps, -CB-
  4. Never use register globals if your not sure about the security issues involved therein; This part of your code: switch ($action) im guessing should be switch ($_GET['action']) hope this helps, -CB-
  5. Hmm, looks like an old outdated and incomplete class imo. There are many advanced and up-to-date classes out there but if you want to use this class, try a few debugging steps: Execute your query manually., Execute it in phpmyadmin, or remove the silence symbols (forgot the name) in front of the mysql_query calls in the class: <?php case "mysql": if (!array_key_exists($name, self::$savedQueries)) { self::$savedQueries[$name] = mysql_query($sql, self::$connection) or Error::LogError("Query Failed", mysql_error(self::$connection)); } break; case "mysqli": if (!array_key_exists($name, self::$savedQueries)) { self::$savedQueries[$name] = mysqli_query(self::$connection, $sql) or Error::LogError("Query Failed", mysqli_error(self::$connection)); } break; ?> Hope this helps, -CB-
  6. For examples of Referenced Variables see: http://www.php.net/manual/en/language.references.php
  7. if that is the code you are missing: "Class" decleration: should be "Class MyClass" "Function" Declerations: Should be "Function __construct" "Function get_myvar" and your missing the dollar symbol in front of your class property: should be "private $myVar" Then this should work: <?php Class MyClass { private $myVar; function __construct() { $this->myVar = 10; } function get_myvar() { return $this->myVar; } } $myclass = New MyClass(); echo($myclass->get_myvar()); ?> Hope this helps, -CB-
  8. I'll give you the code even though it's a little more bulky than rajivgonsalves: <?php $text = "Full Tilt Poker Game #16783843176: Table Charger (deep) - $3/$6 - No Limit Hold'em - 22:07:32 ET - 2009/12/13 Seat 1: SadLittleDoggy ($998) Seat 2: Amorpheous ($180) Seat 3: novel20 ($1,257) Seat 4: drillhead7619 ($326.55) Seat 5: RobSainter ($894) Seat 6: mjm32088 ($391) Seat 7: leja2 ($807.90) Seat 8: jeffr8 ($1,066.50) Seat 9: HellaStacks_ ($810) HellaStacks_ posts the small blind of $3 SadLittleDoggy is sitting out Amorpheous posts the big blind of $6 The button is in seat #8 *** HOLE CARDS *** Dealt to jeffr8 [Ac Ah] SadLittleDoggy stands up novel20 folds drillhead7619 folds RobSainter folds mvisman adds $360 mjm32088 has 15 seconds left to act mjm32088 folds leja2 folds jeffr8 raises to $16.50 HellaStacks_ has 15 seconds left to act HellaStacks_ raises to $66 Amorpheous folds jeffr8 calls $49.50 *** FLOP *** [As Qd Tc] HellaStacks_ has 15 seconds left to act HellaStacks_ bets $118 jeffr8 raises to $246 HellaStacks_ has 15 seconds left to act HellaStacks_ calls $128 *** TURN *** [As Qd Tc] [Jc] HellaStacks_ bets $498, and is all in jeffr8 calls $498 HellaStacks_ shows [Ad Ks] jeffr8 shows [Ac Ah] *** RIVER *** [As Qd Tc Jc] [7h] HellaStacks_ shows a straight, Ace high jeffr8 shows three of a kind, Aces HellaStacks_ wins the pot ($1,623) with a straight, Ace high *** SUMMARY *** Total pot $1,626 | Rake $3 Board: [As Qd Tc Jc 7h] Seat 1: SadLittleDoggy is sitting out Seat 2: Amorpheous (big blind) folded before the Flop Seat 3: novel20 didn't bet (folded) Seat 4: drillhead7619 didn't bet (folded) Seat 5: RobSainter didn't bet (folded) Seat 6: mjm32088 didn't bet (folded) Seat 7: leja2 didn't bet (folded) Seat 8: jeffr8 (button) showed [Ac Ah] and lost with three of a kind, Aces Seat 9: HellaStacks_ (small blind) showed [Ad Ks] and won ($1,623) with a straight, Ace high"; preg_match_all("/\[[a-z ]+\]/i",$text,$matches); // returns a multi dimensional array. /* EG: array{ [0]=> array{ [0]=> "[Ac Ah]" [1]=> "[As Qd Tc]" [2]=> "[As Qd Tc]" [3]=> "[Jc]" [4]=> "[Ad Ks]" [5]=> "[Ac Ah]" [6]=> "[As Qd Tc Jc]" [7]=> "[Ac Ah]" [8]=> "[Ad Ks]" } } */ // Declare variables so we dont get notice errors; $replace_strings = $matches[0]; // These are the original strings. $replacement_strings = array(); // Will be replaced with these strings. // loop each bracket; foreach($matches[0] as $bracket){ // Get rid of the brackets. $bracket = substr($bracket,1,strlen($bracket) - 2); // Get each individual character string $this_str_array = explode(" ",$bracket); // Check if it's an array if(!is_array($this_str_array)){ // To be honest this shouldnt happen $temp_string = "[".$bracket.".jpg]"; // Add the replacement string }else{ // Start with a bracket $temp_string = "["; // Add each image foreach($this_str_array As $chars){ $temp_string .= $chars.".jpg"; } // End with a Bracket $temp_string .= "]"; } // Add Result $replacement_strings[] = $temp_string; } $text = str_replace($replace_strings,$replacement_strings,$text); echo($text); Maybe you'll learn something from this one too; With all the comments. -CB-
  9. Ok so i lost the entire message because of the editing limit. Thanks SMF......... (should let you copy and paste ur message somewhere or let you post a reply instead...) anyway; Two options: (this will be blunt because im slightly aggravated, but should help anyways); 1. Use preg_replace, with a special syntax you can do this on a single line of code. Otherwise; 2. Use my Method described below: :Concept: 1. Use Preg_Match_All() to get every bracket and put it into an array. 2. Save the array as the original (used later to replace the originals). 3. Loop through each original array item whilst: 4. (per item) remove left and right bracket from the string; 5. (per item) explode the string by the space character (Creates an array of strings that were seperated by the space char); 6. (per item) loop each new string item from the new array and change it into an image (save them into a temp variable); 7. (per item) add the brackets on the front and back of the new string to the temp variable. 8. add the temp variable to a new array 9. use str_replace with the original and new arrays to replace each bracket one at a time. Voila!. Make some code and i'll help you with it (i have written the code but u must learn so go write something!) Hope this Helps -CB-
  10. ugh, tab then enter = bad things. 1 sec
  11. You change the number 4 into a variable, and set it earlier in the script.
  12. So, am i right in thinking, you want a page where you can delete images, when you delete an image it says "deleted", and then returns you to the "gallery" so to speak? You could try using a Header redirect, From the original page with the images->Click delete->Go to delete.php, displays "File deleted", with a link "Continue", then that link goes back to the original page with the images. Hope this Helps, -CB-
  13. The easiest method is a recurring substr function: use a while() loop eg: <?php $cstring = "hj45ederl840lmcjower oldwsd3ohwxrzswlzswd"; $new_string = substr($cstring,0,1); // Gets the first letter. $cstring = substr($cstring,1); // Removes First letter from current string. while($more_left == true){ // While there is more to do, continue the loop. // If there is at least 4 characters left (3 to skips and 1 to add), then do this. if(strlen($cstring) >= 4){ $new_string .= substr($cstring,3,1); // Add the fourth letter (skip 3 letters) $cstring = substr($cstring,4); // Get rid of that last part so we can continue with the next letter. }else{ $more_left = false; // If there arent enough characters to skip then there must be no characters to save, so break the loop. } } echo($new_string); // Untested. ?> That should work. substr is extremely useful. Hope this Helps, -CB-
  14. Hmm, If the above reply doesn't help you, try this function: <?php // Fixes the encoding to uf8 function fixEncoding($in_str) { $cur_encoding = mb_detect_encoding($in_str) ; if($cur_encoding == "UTF-8" && mb_check_encoding($in_str,"UTF-8")) return $in_str; else return utf8_encode($in_str); } // fixEncoding ?> mb_detect_encoding() is useful in determining the current encoding, Which can help you debug easier - if it is the fact that the string was not UTF-8. Hope this Helps. -CB-
  15. Dont you use hacks on your forums? - looks like you do . I dont think smf devs will do anything, since will be changing the default sort order. Would be specific to this type of "support" forum. Just an idea that would help people that aren't getting answered . -CB-
  16. I suggest adding some sort of "0 Replies" search, ordered most recent first. Currently sorting the Replies field in Ascending Mode results in the oldest messages being displayed first. It would be much more logical to display the most recent messages with 0 replies. Should be simple, just add the old double sort order in the sql query . If($some_sort_variable = 'replies'){ $someclass->sql_append('SORT BY `reply_count`,`creation_date`'); } dunno how ur forum code is structured but shud be something similar. -CB-
  17. Hate finding 0 replies so i'll try lol (Bear in mind i didnt know what filemaker was before i read this post.); There are two possible reasons; a) It's on purpose (A Setting, and Algorithm Given for that specific Export Feature) b) It's a bug in the code that will need to be fixed by the devlopers. You have a few options at your disposal though; If (a): 1. Go through any settings or Preferences and look for any exporting options, or replacement options etc. 2. Try Reinstalling the application (Make sure to backup your data) 3. Try a different (Older or Newer) Version of the software. if (b): 1. Try a different Version of the Software (Either the bug is new or old). 2. Tell the developers about the bug and anything you think of that can cause it ie; Try exporting much smaller database from the software with that "ad" pattern and see if it's a size thing etc. Hope this Helps, Good Luck.
  18. Hey Guys and Gals , Just popping on here to say WASSAP to my fellow coders . Although i probably dont know any of you here. I know my way around php so i will probably mostly be helping people on here (in my spare time ofc ). So, Hey! And soon to be **Merry Christmas** (5 days) and my B-Day! (7 Days). hehehe. Chemical Blisssss.
×
×
  • 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.