Jump to content

laffin

Members
  • Posts

    1,200
  • Joined

  • Last visited

Everything posted by laffin

  1. U prolly looking at resizing the watermark as well as the image. as the watermark is gonna be a percentage of the actual image. Image -> Resize Watermark -> Generate -> Resize Overlay Images
  2. more than likely uploadfolder is not allowed to run cgi/php.
  3. sounds more like a web server configuration problem.
  4. now topic said, keeping track of pages, yet u describe a last 10 users. so question is are u tracking users or page views.
  5. yer looking at resizing or scaling an image down. found a tutorial for ya Image resizing
  6. depends if u want user to see the output of the scripts or not. if they are generated images, u can use the <IMG tag, so user can see the generated output. if u dun want user to see the scripts output, u can use fopen('url'), however keep in mind of the timeout.
  7. function prc($mathes) { return '<a href="'.BASEDIR."user?id=$matches[1]">'. getUserName($matches[1]) . '</A>'; } $text = preg_replace_callback('#\[user=(.*?)\]#si', 'prc', $text);
  8. $host=parse_url ( $to , PHP_URL_HOST ); will return the hostname than ya can use strstr or preg_replace for the removal of www. portion.I wud opt for preg_replace $host=preg_replace("/^(www|www[0-9])?\.?([\w\.]*)$/i",'\2',$host);
  9. illegal, as the replacement string in preg_replace is to be static (same thing, nothing dynamic) u will want to go with preg_replace_callback, so u can stick in the extra function getusername into the replacement string
  10. <?php header('Content-type: text/plain'); $date_written = strtotime($row_GetArticle['date_written']); if($date_written < strtotime('-1 Year')) echo "Over"; else echo "Under"; echo " a year old"; ?>
  11. than continue using the options preg_match offers $title = "Abit IL9 Pro (Retail, RAID, Gb-LAN, Sound, ATX) - €54322,57322"; preg_match('/- € (\d+,\d+)/si', $title, $price); print_r($price); $price[0] will display the whole match string as u have seen already $price[1] will display the price value
  12. Checkbox shudn display any text, just a check box. so the value, can be the product id code instead of the product price. on the processing page u can than pull both price/description from the db from the id.
  13. have the script check for the existance of a file to abort operations. if it exists, remember to unlink the file before aborting. the creation of the file can be done thru another script. so ya want to have a read/write directory.
  14. as thorpe suggested use normalization seperate the plots of land into there own db. TABLE ( userid position crop end_time ) KEY `userplot` (userid,position) than ya can grab userid and position from the table. and build a positional array. $res=mysql_query("SELECT position WHERE userid=$uid") while($row=mysql_fetch_row($res)) { $plots[$row[0]]=true; } notice that the position of the crop is not a value. thus making a simple check if a plot is used by if(isset($plots[5])) echo "Plot 5 is used"; else echo "Plot 5 is not used";
  15. directory names, shud go further down the directory root, so ya want to avoid '..' which ya can check with realpath function class names, if u know what to expect, store them in an array and do a comparison check, in_array function
  16. oops in my haste messed up the conversion to using preg_replace_callback it shud be $sul=preg_replace_callback('#<td class=\"(.*?)\" align=(.*?)>#',' UpdCounter', $sul)
  17. use preg_replace_callback <?php $counter=0; function UpdCounter($matches) { global $counter; return "JAZZ" .++$counter. $matches[1]; } $sul=preg_replace_callback('#<td class=\"(.*?)\" align=(.*?)>#',' JAZZ ', $sul) ?>
  18. why not just implement the sessions in your own fashion. Thus bypassing sessions entirely
  19. Correct According to php doc on date function So it shud start at 00:01 am Monday
  20. maybe using sumfin like $which=(intval(date("W")))&1; it takes the week number (52 weeks in a year), and strips off all higher numbers besides 1. so giving u 2 states 0 or 1.
  21. check boxes dun work as 0 or 1. they work as not set or set which can also be dun as a boolean check (wich is what u are after) if(isbox) btw, you never set the array group_row
  22. store the last on into his acct and do this periodically with a mysql query check $res=mysql_query("SELECT id FROM users WHERE TO_DAYS(NOW()) - TO_DAYS(last_on) >= 30");
  23. I provided a simple example in another thread Form Validation
  24. Most systems use number based values for user levels User = 1 Moderator =5 Editor = 10 Admin = 20 than doing comparison checks for the user level is pretty basic comparison. but if ya want lots more flexibility. u will want to look into bit flags for different activities (Note values are power of 2) Read = 1 Post = 2 Delete = 4 Hide = 8 Edit = 16 and using bit testing to see if a user can preform that action or not, a lot more complex, offers more flexibility.
  25. u can always use the $_GLOBAL['my_global_var']
×
×
  • 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.