Jump to content

xoligy

Members
  • Posts

    232
  • Joined

  • Last visited

    Never

Everything posted by xoligy

  1. Ive actually found away around the disabling of the button now i';ll just put the code on the apges that its needed so i just need to know how to add an extra validation rule on the js above
  2. im using this one $txt = str_replace("[b]", "<b>", $txt); $txt = str_replace("[/b]", "</b>", $txt); $txt = str_replace("[i]", "<i>", $txt); $txt = str_replace("[/i]", "</i>", $txt); $txt = str_replace("[u]", "<u>", $txt); $txt = str_replace("[/u]", "</u>", $txt); $txt = str_replace("[quote]", "<div id=quote><b>QUOTE:</b>", $txt); $txt = str_replace("[/quote]", "</div>", $txt); $txt = preg_replace("#\[color=(.+?)\](.+?)\[/color\]#is","<font color=\"\\1\">\\2</font>",$txt);
  3. Ok i just got this bit of javascript below to check for blank fields and it works! The thing is i need a second volidation but im unsure if i just have to copy the whole code again or just add a second part if thats the case im lost lol! Now the second problem i have is that once the button has been pressed that sends the form the person is unable to press the same button again because of some other code i have inplace which stops that! So how would i get around that? I carnt just remove the other code as its needed :/ <SCRIPT LANGUAGE="JavaScript"> function validate_required(field,alerttxt) { with (field) { if (value==null||value=="") {alert(alerttxt);return false;} else {return true} } } function validate_form(thisform) { with (thisform) { if (validate_required(topic,"You forgot to enter a subject title!")==false) {topic.focus();return false;} } } </script>
  4. with the &quot u wanted lol 169 1 asdasdsa Admin test 'test' and "test" 2008-09-15 05:24:42 05:24:00 <TH align=left style="padding-left: 5px; font-size: 12px;">September 15th, 2008</TH> <TR><TD width="100%"><p><b style="font-size: 16px;">asdasdsa</b></TD> <TR><TD style="font-size: 10px;">Posted by: <b><a href="stats.php?id=1">Admin</a> at 05:24 AM <a href="comments.php?id=169">Comments|0</a></font></b></TD> <TR><TD><div class="content-box"><p>test 'test' and "test"</div></TD>
  5. this is my db 168 1 asdsad Admin < blah > 2008-09-15 05:19:11 05:19:00 the page <TR><TD width="100%"><p><b style="font-size: 16px;">asdsad</b></TD> <TR><TD style="font-size: 10px;">Posted by: <b><a href="stats.php?id=1">Admin</a> at 05:19 AM <a href="comments.php?id=168">Comments|0</a></font></b></TD> <TR><TD><div class="content-box"><p>< blah ></div></TD> i managed to do it somehow :-/
  6. Sorry but i admit i am an idiot Crayon lol Anyhow i believe i fixed the error with the following changes in the code: <? function generate_pagination($base_url, $num_items, $per_page, $start_item, $tru, $add_prevnext_text = TRUE) { $total_pages = ceil($num_items/$per_page); if ( $total_pages == 1 ) { return ""; } $on_page = floor($start_item / $per_page) + 1; $page_string = ""; if ( $total_pages > 5 ) { $init_page_max = ( $total_pages > 3 ) ? 3 : $total_pages; for($i = 1; $i < $init_page_max + 1; $i++) { $page_string .= ( $i == $on_page ) ? "<b>" . $i . "</b>" : "<a href=\"$base_url&tru=$tru&start=" . ( ( $i - 1 ) * $per_page ) . "\">" . $i . "</a>"; if ( $i < $init_page_max ) { $page_string .= ", "; } } if ( $total_pages > 3 ) { if ( $on_page > 1 && $on_page < $total_pages ) { $page_string .= ( $on_page > 4 ) ? " ... " : ", "; $init_page_min = ( $on_page > 3 ) ? $on_page : 6; $init_page_max = ( $on_page < $total_pages - 4 ) ? $on_page : $total_pages - 4; for($i = $init_page_min - 1; $i < $init_page_max + 2; $i++) { $page_string .= ($i == $on_page) ? "<b>" . $i . "</b>" : "<a href=\"$base_url&tru=$tru&start=" . ( ( $i - 1 ) * $per_page ) . "\">" . $i . "</a>"; if ( $i < $init_page_max + 1 ) { $page_string .= ", "; } } $page_string .= ( $on_page < $total_pages - 2 ) ? " ... " : ", "; } else { $page_string .= " ... "; } for($i = $total_pages - 2; $i < $total_pages + 1; $i++) { $page_string .= ( $i == $on_page ) ? "<b>" . $i . "</b>" : "<a href=\"$base_url&tru=$tru&start=" . ( ( $i - 1 ) * $per_page ) . "\">" . $i . "</a>"; if( $i < $total_pages ) { $page_string .= ", "; } } } } else { for($i = 1; $i < $total_pages + 1; $i++) { $page_string .= ( $i == $on_page ) ? "<b>" . $i . "</b>" : "<a href=\"$base_url&tru=$tru&start=" . ( ( $i - 1 ) * $per_page ) . "\">" . $i . "</a>"; if ( $i < $total_pages ) { $page_string .= ", "; } } } if ( $add_prevnext_text ) { if ( $on_page > 1 ) { $page_string = " <a href=\"$base_url&tru=$tru&start=" . ( ( $on_page - 2 ) * $per_page ) . "\">Prev</a> " . $page_string; } if ( $on_page < $total_pages ) { $page_string .= " <a href=\"$base_url&tru=$tru&start=" . ( $on_page * $per_page ) . "\">Next</a>"; } } return $page_string; } ?>
  7. thanks will work on this tomorrow and see how i do haha
  8. looks liek he's trying to fall pages from functions???
  9. Anyone know how that would be coded or where there is a tut, thinking of adding it if i can figure it out o.0
  10. Well im back i did get the pagination working how i wanted by changing if ($total_pages > 10){ to 5 but now i have this display issue "Prev 1, 2, 3, , 4, 5, 6 Next" or this one "Prev 1, 2, 3 ... , 6, 7, 8 Next" (depends on how many pages there are. function generate_pagination($base_url, $num_items, $per_page, $start_item, $tru, $add_prevnext_text = TRUE) { $total_pages = ceil($num_items/$per_page); if ( $total_pages == 1 ) { return ""; } $on_page = floor($start_item / $per_page) + 1; $page_string = ""; if ( $total_pages > 5 ) { $init_page_max = ( $total_pages > 3 ) ? 3 : $total_pages; for($i = 1; $i < $init_page_max + 1; $i++) { $page_string .= ( $i == $on_page ) ? "<b>" . $i . "</b>" : "<a href=\"$base_url&tru=$tru&start=" . ( ( $i - 1 ) * $per_page ) . "\">" . $i . "</a>"; if ( $i < $init_page_max ) { $page_string .= ", "; } } if ( $total_pages > 3 ) { if ( $on_page > 1 && $on_page < $total_pages ) { $page_string .= ( $on_page > 5 ) ? " ... " : ", "; $init_page_min = ( $on_page > 4 ) ? $on_page : 5; $init_page_max = ( $on_page < $total_pages - 4 ) ? $on_page : $total_pages - 4; for($i = $init_page_min - 1; $i < $init_page_max + 2; $i++) { $page_string .= ($i == $on_page) ? "<b>" . $i . "</b>" : "<a href=\"$base_url&tru=$tru&start=" . ( ( $i - 1 ) * $per_page ) . "\">" . $i . "</a>"; if ( $i < $init_page_max + 1 ) { $page_string .= ", "; } } $page_string .= ( $on_page < $total_pages - 4 ) ? " ... " : ", "; } else { $page_string .= " ... "; } for($i = $total_pages - 2; $i < $total_pages + 1; $i++) { $page_string .= ( $i == $on_page ) ? "<b>" . $i . "</b>" : "<a href=\"$base_url&tru=$tru&start=" . ( ( $i - 1 ) * $per_page ) . "\">" . $i . "</a>"; if( $i < $total_pages ) { $page_string .= ", "; } } } } else { for($i = 1; $i < $total_pages + 1; $i++) { $page_string .= ( $i == $on_page ) ? "<b>" . $i . "</b>" : "<a href=\"$base_url&tru=$tru&start=" . ( ( $i - 1 ) * $per_page ) . "\">" . $i . "</a>"; if ( $i < $total_pages ) { $page_string .= ", "; } } } if ( $add_prevnext_text ) { if ( $on_page > 1 ) { $page_string = " <a href=\"$base_url&tru=$tru&start=" . ( ( $on_page - 2 ) * $per_page ) . "\">Prev</a> " . $page_string; } if ( $on_page < $total_pages ) { $page_string .= " <a href=\"$base_url&tru=$tru&start=" . ( $on_page * $per_page ) . "\">Next</a>"; } } return $page_string; }
  11. Ok i'll try and explain a little better and see if i ge a response. I have a page that when it loads i would like it to display an image in a certain part of the page then after a few secods (lets say 3) i want that image to be replaced with a block of text. Does anyone know how to do this or can point me in the right direction?
  12. I ended up sorting it i was trying to change the data in the wrong file yet again *sugh* thanks anyway crayon
  13. Ok thought i just fixed this but seems i was also copying every post 3x lol Basically everything is set up but here is the problem i want it to display the numbers 1,2,3...99, 100, 101 but without disrupting how many items per page are displayed so if i have 700posts i should have 10 pages and the pagination will look like 1, 2, 3...8, 9, 10 but how it is is 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 anyhow here is the code: <? $query = mysql_query("SELECT * FROM $tab[forum_post] WHERE topic_id=$topicid ORDER BY post_id LIMIT $start, $itemperpage"); $this_page = mysql_num_rows($query) or die("No post records found!"); $paging = generate_pagination("viewtopic.php?topicid=$topicid", $all_record, $itemperpage, $start, $tru); ?>
  14. helps if people post errors and put code in [ code ] [ /code ] tags, also where are your db username and password setup? as said do you have a db even setup with the right tables?
  15. How would this be achieved? Basically i have a page where i would like an image shown for x seconds and then some text replaces it... I know i'll prob be back otmorrow with more q's but this one is the most important at the moment, besides i need more time looking up textbox validatoin!
  16. i have something similar to the one projectfear posted this one blanks out the length of the word with * so if someone said the f word thats 4 stars if they said one with 8letters 8 stars etc etc. function filter_lang($Input) { $obscenities = array("*+*++*+*","*-*-*-*-*", ); foreach ($obscenities as $curse_word) { if (stristr(trim($Input),$curse_word)) { $length = strlen($curse_word); for ($i = 1; $i <= $length; $i++) { $stars .= "*"; } $Input = eregi_replace($curse_word,$stars,trim($Input)); $stars = ""; } } return $Input; }
  17. Thanks tmbrown will give it ago and see what happend
  18. Not really its for purchasing something from the site
  19. What would be the best way to protect and email address on a hidden object? <input type="hidden" name="business" value="<?=$adminpaypal?>">
  20. Basically as far as i can tell the code im using makes a page and when it reaches a page limit that is set starts another and so on right no im upto page 8 so it displays like this: 1, 2, 3, 4, 5, 6, 7, 8 what i would like is something like this: 1, 2, 3....7, 8 or 1,2....7, 8 Its just so if a post gets popular then im not going to have numbers going all the way across a page lol
  21. Thanks i'll sort that out now and have a look at this code later its doing my head in now lol
  22. Not getting an error the db is set to varchar (255) i have somehting the same for withdraw that works thats why im puzzled ??? edit: you can see both version here: http://pastebin.com/pastebin.php?diff=m6a85248e
  23. Ive been trying to figue out whats up with this for nearly an hr and so far ive got nowhere im really stumped on this. Basically im entering an amount ot add so lets say 1k so i enter "1000" press enter and get "Numbers Only!'" since when wasn't "1000" numbers ??? if ($putmoney) { // pinoywebdev add s $id = cln($id); // pinoywebdev add e $pimp = mysql_fetch_array(mysql_query("SELECT pimp, trn, money FROM $tab[pimp] WHERE id='$id'")); $bank = mysql_fetch_array(mysql_query("SELECT pimp, money FROM $tab[bank] WHERE id='$id'")); $md = ($maxdep) ; if($deposit > $pimp[2]) { echo "<html><body><script language=javascript1.1>alert('You do not have that much money!');</script><noscript>Your browser doesn't support JavaScript 1.1 or it's turned off in your browsers preferences.</noscript></body></html>"; } elseif(!preg_match ('/^[0-9][0-9]*$/i', $deposit)) { echo "<html><body><script language=javascript1.1>alert('Numbers Only!');</script><noscript>Your browser doesn't support JavaScript 1.1 or it's turned off in your browsers preferences.</noscript></body></html>"; } elseif($deposit <= 0) { echo "<html><body><script language=javascript1.1>alert('Please enter a positive ammount!');</script><noscript>Your browser doesn't support JavaScript 1.1 or it's turned off in your browsers preferences.</noscript></body></html>"; } elseif($deposit > $maxdep) { echo "<html><body><script language=javascript1.1>alert('You can not deposit more than the maximum amount!');</script><noscript>Your browser doesn't support JavaScript 1.1 or it's turned off in your browsers preferences.</noscript></body></html>"; } elseif($deposit + $bank[1] > $md) { echo "<html><body><script language=javascript1.1>alert('You can not deposit more than the maximum amount!');</script><noscript>Your browser doesn't support JavaScript 1.1 or it's turned off in your browsers preferences.</noscript></body></html>"; } elseif($pimp[1] < $depositturns) { echo "<html><body><script language=javascript1.1>alert('You do not have enough turns to deposit.');</script><noscript>Your browser doesn't support JavaScript 1.1 or it's turned off in your browsers preferences.</noscript></body></html>"; } else { // pinoywebdev add s $depositturns = cln($depositturns); $deposit = cln($deposit); // pinoywebdev add e mysql_query("UPDATE $tab[bank] SET money=money + $deposit WHERE id='$id'"); mysql_query("UPDATE $tab[pimp] SET trn=trn - $depositturns, money=money-$deposit WHERE id='$id'"); echo "<html><body><script language=javascript1.1>alert('Money Deposited');</script><noscript>Your browser doesn't support JavaScript 1.1 or it's turned off in your browsers preferences.</noscript></body></html>"; report("deposited " . commas($deposit) . "$ to the bank"); } }
  24. Ok people im working on something i didnt write myself and the code below does as it should but is there a way to make it like a forum? By that i mean it shows 1,2,3,...whatever <? $paging = generate_pagination("viewtopic.php?topicid=$topicid", $all_record, $itemperpage, $start, $tru); if ($paging == "") echo ""; echo "<table width=\"100%\"><tr><td align=\"right\">" . $paging . "</td></tr></table>"; ?>
×
×
  • 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.