-
Posts
1,099 -
Joined
-
Last visited
-
Days Won
3
Content Type
Profiles
Forums
Events
Everything posted by Lithium
-
On the encyclopedia.php to link to the iteminfo.min.php {$p['itmname']} then create the iteminfo.min.php as wrx stated he has done
-
Also, you're making the positioning incorrect... <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"> $("[rel=item_info]").fancybox({ 'width' : '50%', 'height' : '70%', 'autoScale' : false, 'transitionIn' : 'none', 'transitionOut' : 'none', 'type' : 'iframe' }); </script> </head>
-
"SELECT ID,STAT,VALUE ORDER BY VALUE DESC LIMIT 0,1" This could be the answer (with your given layout example) , yet the table layout is something i can't change unfortunatelly. Despite that, your approach made me think and i managed to get a solution, not a fancy nor practical one, but just as good. with the examples given it ought to be something on these lines (for those who might be interested) select ID, case when value1 >= value2 and value1 >= value3 and value1 >= value4 then 'VALUE1' when value2 >= value1 and value2 >= value3 and value2 >= value4 then 'VALUE2' when value3 >= value1 and value3 >= value2 and value3 >= value4 then 'VALUE3' else 'VALUE4' end, (SELECT GREATEST(`VALUE1`,`VALUE2`,`VALUE3`,`VALUE4`) AS `max` FROM `test`) FROM `test` The bad from this... a big table layout needs to have a few tweaks to generate the query the fastest possible, yet the overall performance goes quite fine and acceptable :) Thanks to Zed and a_bertrand to point me out on the right direction :thumbsup:
-
@ CJ and gurpreet, you need jquery, and a link to the jquery file right above the bit wrx posted to be placed on header... <script type="text/javascript" src="path/to/jquery.js"></script>
-
@ gurpreet It should fit with no problems, but if you are too picky with the code... ;) <?php $r = $db->fetch_row($db->query("SELECT COUNT(*) as `cnt` FROM `mail` WHERE `mail_to` = {$ir['userid']} AND `mail_read` = 0")); if($r['cnt']) { echo '<script type="text/javascript"> var r=confirm("You have new Mail\n Veiw?") if (r==true) { window.location = "http://www.yourdomain.com/mail.php"; } else {} </script>';} ?>
-
Now yet another doubt. I got the higher value, is it possible to know what field it stands for?
-
Heh! Definetly! Thx for the pointer Zed :) And a note... you don't need the limit there as you're selecting only one value ;)
-
CREATE TABLE `test` ( `ID` int(11) NOT NULL AUTO_INCREMENT, `VALUE1` int(11) NOT NULL, `VALUE2` int(11) NOT NULL, `VALUE3` int(11) NOT NULL, `VALUE4` int(11) NOT NULL, PRIMARY KEY (`ID`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; INSERT INTO test VALUES(NULL,'100','200','500','1000'); Let's say that i want to select ONLY the highest value on the fields, which can be any of them. (SELECT * FROM table ORDER BY field DESC LIMIT 1 is not an option) What is the best solution for such an option? Thanks for any help!
-
ermmm.... that needs to be inside the while(). also, you can improve the code a bit... if($ir['maxwill'] == $mp['hWILL']) { $will = "{$mp['hWILL']}"; } else { $will = "???"; } can be $will = ($ir['maxwill'] == $mp['hWILL']) ? $mp['hWILL'] : "n/a"; yet this will not do what you wanted to... for what i understood, you want to "lock" will display on houses bigger than user's current house right? if so... $will = ($ir['maxwill'] > $mp['hWILL']) ? $mp['hWILL'] : "n/a";
-
Register... avoiding malicious input from start! Login... avoiding malicious input from getting into sessions, ingame. Header... the file is called upon every single request making it main way to lock every single down call... What else can you secure that hasn't been already checked?
-
Showing all houses even those lower than you have... change this... $hq=$db->query("SELECT * FROM houses WHERE hWILL>{$ir['maxwill']} ORDER BY hWILL ASC"); to this $hq=$db->query("SELECT * FROM houses ORDER BY hWILL ASC"); Also if you want to display the house will... as in the default estate.php $r['hWILL'] will display the will on the house you're echoing on the while()
-
Complementing what a_bertrand said, i am not a fan on increasing the connections number for the same reasons he stated, so making it another point... 3) use mysql_close() more often, that if you even use it :)
-
Can someone just check over this quick please
Lithium replied to CherryDarling's topic in General Discussion
it is correct, and the error you get is not related to that but missing operators as i pointed you out! just fix those and you will notice it! though it can error out again if you have still missing closure's before/after those lines -
Can someone just check over this quick please
Lithium replied to CherryDarling's topic in General Discussion
Forum Info Change Should be Forum Info Change "; And echo "Bank Pin Change Should be echo "Bank Pin Change "; And echo "Apply for a Bank Pin Should be echo "Apply for a Bank Pin "; Also seems to be a missing echo " on the last line you pasted!!! -
Following cjholder question, and his attempt to make it run, here it goes a working example on multiple images! <?php function loadpng($imgname) { $im = @imagecreatefrompng($imgname); if(!$im) { $im = imagecreatetruecolor(160, 16); $bgc = imagecolorallocate($im, 255, 255, 255); $tc = imagecolorallocate($im, 0, 0, 0); imagefilledrectangule($im, 0, 0, 160, 16, $bgc); imagestring($im, 1, 5, 5, 'Error loading ' .$imgname, $tc); } return $im; } header('Content-Type: image/png'); //array needed to place new images $image = array("yellow" => "yellow.png", "red" => "red.png", "blue" => "blue.png"); // $img = loadpng('images/bar.png'); (old style, single image) $img = loadpng('images/'.$image[$_GET['type']]); $impb = imagecreatetruecolor(160, 16); // percentage (%) $percentage = round($_GET['p']); if($percentage < 0 && $percentage > 100) $percentage = 0; // don't change $full_min = 1; $full_max = 160; $empty_max = 320; $empty_min = 160; // copy full first; $full_s = round( $full_max * $percentage / 100 ); imagecopy($impb, $img, 0, 0, $full_min, 0, $full_s, 16); // copy empty $dst_x = $full_s; $src_x = $empty_min + $full_s; $src_w = round(($empty_max - $empty_min) * (100 - $percentage) / 100); imagecopy($impb, $img, $dst_x, 0, $src_x, 0 , $src_w , 16); imagepng($impb); imagedestroy($img); imagedestroy($impb); ?> Finally displaying the images... [img=progress.php?type=coloryouwant&p=<?=floor($var)?>]
-
NULLED is every single bit of "software" that has been altered from it's original form. As far as i know, MCCodes is widely spread on it's original form, as the original distribution package offered by its owner. An illegal copy it is what your friend might have, though very unlikely a "NULLED" version. The term "NULLED" is often used for open source projects, when licensing methods are altered, either removed and/or decoded from the protections they use. As of this as MMCodes has no such protection, it is simply a way to have more "visibility" among illegal software, as if it had any protection on it. It's illegal. Period!
-
2 crimes... level 3 on the spot... crimes with 1 brave and above, being THAT easy to make 5 brave crimes with base stats (10)... i must say... close it, and go back to the drawing board, i'm not trying to bring you down, though if you keep stuff as it is... the game will be dead in less than nothing! As far of the rest, enough seen with the crimes like that, plus gym giving basicly on 1st train 3 times the amount of initial stat..., i can figure out you have made absolutely no changes and/or if you made them... it was for worst!
-
@SHAD: read this article, it might give you some lights on what is what. http://www.websitetemplatedesign.com/oscommerce_tutorials/printer_136.shtml Despite bigger images, png is not necessaryly a better quality standard!!!
-
Thx for cjholder for the 2nd progress bar (the "crappy bar" one), added to the OP.
-
If you know what you are doing... yes! :whistling: Something along these lines... $chooseimg = array("yellow" => "images/yellow.png", "blue" => "images/blue.png", etc etc etc) changing the $img accordingly... $img = $img = loadpng($chooseimg[$_GET['type']]); And finally... the display it self needs a bit tweaking... This is untested and its only a guideline to achieve the result :)
-
What about adding a $var to different images and then displaying them as requested? Is that hard? ;)
-
ORLY? i work with PHP, and its quite exactly the same on both! :P
-
Thats MCV2 isn't it? (*I've never seen MCCV1..*) @OP; Just create a new function >_< Look at MCCodes V2 and edit to you're needs :) Should work You know why you haven't seen it? because you don't open your eyes! :P near the bottom of header.php "function endpage" ;)
-
You already have something like that... you might know it as $h->endpage(); ...
-
How many of you get annoyed when your progress bars grow more than they should and ruin your layout? Also, how many of you are tired of the same old same progress bar styles? I've made a small replacement a while back for the progress bars which i decided noqw to share. You can see them in action in http://www.deadlycountry.net So here it go, Name this file let's say bars.php and place it somewhere on your public_html folder <?php function loadpng($imgname) { $im = @imagecreatefrompng($imgname); if(!$im) { $im = imagecreatetruecolor(160, 16); $bgc = imagecolorallocate($im, 255, 255, 255); $tc = imagecolorallocate($im, 0, 0, 0); imagefilledrectangule($im, 0, 0, 160, 16, $bgc); imagestring($im, 1, 5, 5, 'Error loading ' .$imgname, $tc); } return $im; } header('Content-Type: image/png'); /* The next line assumes that you have this file located on the site's public_html folder */ $img = loadpng('images/bar.png'); $impb = imagecreatetruecolor(160, 16); // percentage (%) $percentage = round($_GET['p']); if($percentage < 0 && $percentage > 100) $percentage = 0; // don't change $full_min = 1; $full_max = 160; $empty_max = 320; $empty_min = 160; // copy full first; $full_s = round( $full_max * $percentage / 100 ); imagecopy($impb, $img, 0, 0, $full_min, 0, $full_s, 16); // copy empty $dst_x = $full_s; $src_x = $empty_min + $full_s; $src_w = round(($empty_max - $empty_min) * (100 - $percentage) / 100); imagecopy($impb, $img, $dst_x, 0, $src_x, 0 , $src_w , 16); imagepng($impb); imagedestroy($img); imagedestroy($impb); ?> Progress bar image is attached to this post as well. If there is someone kind enough to make a layered psd out of it i would be much apprecciated, as i lost my original one :( Now let's apply it on! Where you have your progress bars, simply remove the code and replace it for: [img=bars.php?p=<?=floor($var)?>] Where $var should be: (check header.php) $enperc, $wiperc, $experc, $brperc, $hpperc. This ones can be deleted afterwards: $enopp, $wiopp, $exopp, $bropp, $hpopp. Finally, the progress bar can be at this sizes: 160*16 (as the above example), 140*14 ... (resize it on the same ratio for better looking). The image i provide looks bad below 100*10 so try to make it look at least decent :) Any comments, good or bad (constructive) are always welcome!!