-
Posts
242 -
Joined
-
Last visited
Posts posted by matfish
-
-
function SortByDate($a, $b) { if ($a['pubDate'] == $b['pubDate']) return 0; return ($a['pubDate'] > $b['pubDate']) ? -1 : 1; }
usort($array, "SortByDate"); foreach ($array as $item) { //blah blah... output }
the above seems to work. Are you using last RSS?
-
Hey, Im also in the same boat!
Iv merged two arrays from lastRSS and now need to sort the merged array by pubDate.
Anyone?
-
Hi, Thanks for the link.
If I was confident enough with javascript I would have figured it out by now. Its not exactly overcoming the problem that when Iv selected the date, I need to calculate the age from a dd-mm-yyyy format (if I could explosed the date like I would in php I wouldnt have an issue).
Any ideas? Take a date from dd-mm-yyyy in an input box and explode it to format: displayage(yyyy, mm dd, "years", 0, "rounddown")
?
-
Hi,
Iv got a popup calendar which your able to select a date in the format of dd-mm-yyyy, I then want to display that persons age after selecting the date.
Any ideas?
-
Hey, many thanks - worked a treat!
Saved me so much hassle!
Thanks again
-
Hey,
Iv got a load of javascript functions in a .js file, but Iv had to manually hardcode each URL. I would like to put a variable like "dir" so I can use like a global directory:
function hide(which){ element = document.getElementById(which); anchr = document.getElementById('a_'+which); img = document.getElementById('i_'+which); element.style.display = 'none'; anchr.href = 'javascript:show(\''+which+'\')'; img.src = '/foldername/image_assets/expand.gif'; }
For example: the above; so that /foldername/ could be specified at the top of the .js file and would inherit throughout all the functions? Oh - trying without to pass a new variable through the function?
Anyone? Please? Thanks
-
function BadWordFilter($text) { $bads = array ( array("ass","a*s"), array("piss","p**s"), array("crap","c**p") ); for($i=0;$i<sizeof($bads);$i++) { $text = eregi_replace($bads[$i][0],$bads[$i][1],$text); } return $text; }
The above woks ok, just wondering if reading from the txt file is quicker or via an array?
-
Hey thanks for the reply, but it dont work.
Text is just output the same ?
-
Hi, str_ireplace throw's a wobbly. Call to undefined function.
Also chocopi - it puts a line break after the word so after every bad word there is a new line...
Thanks for everyones help
-
Hey, thanks - seems to work fine and doesn't interfere with the speed of display (which is what i was worried about)
seems to work only with words that match (case sensitive) - meaning: buGGer is not the same as bugger which is in the list.. any ideas?
Thanks again
-
sorry - being a dumbass - its sorted now
-
How come:
if(!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,6}$", $email)){ echo 'Incorrect'; }
doesnt work? Tried with things like "name", "name@name.com" and it comes back as valid?
Thanks
-
I wanted to do something like if "balls" then "b***s" kinda thing but with a list of bad language words...
-
Yeah, Im that far ahead - but you think its best to run an array thru all the words?
-
Hey,
got a comment/blog type thingy and in the users preferences they have the option to turn a bad language filter on/off.
Im just wondering the quickest way to implement this to view the output? You think put the words into an array and if the word filter is true, then how would i go through all the array of bad words and replace with *** and would this be quick or would it delay viewing the output?
Many thanks
-
Think I understand where your comming from now..
Iv got a form, which is repeated in a loop. If I press submit on the first one, javascript validates it (getelementbyid) which it highlights the box, I would then need id=title1 as this is the first form. Wouldnt both forms light up if I getelementbyid id=title ? withour any ID's after it?
Many thanks.
ps: I think i know what you mean now, as it will use the form id/name to get id=title ? and wouldnt need the number after it?
-
Hey, this is more of a CSS issue and I will post elsewhere, but just wondering as its along the lines of validation.
I have:
<style type="text/css">
#comment_error<?=$slap_detail['slapID']?> {float:left; color:#FFFFFF; padding:2px 2px 2px 2px; margin-top:2px; width:226px; border:1px #000099 solid; }
.comment_error_msg<?=$slap_detail['slapID']?> { width:223px; border:0px #003366 solid; background-color:#458CCC; padding-left:3px; border:1px #FF0000 solid; color:#FFFFFF;}
</style>
which is in a loop as depending on where the error is, is dependant on the id. This works, but the html validator says I cant put this outside of the head tag. Is there anyway of looping in a css document or shall i just repeat the query in the head which will output the css first?
-
Hey thanks for the replies.
lower-casing the mouseovers/onclicks worked thanks.
I have a form which is being repeated (using edit in place with Ajax) so when I press submit, it takes the form_name[id] and then gets the id=title and id=body of that form for validation before posting but these are the things that are being repeated.
I will re-check my coding as I understand id's have to be unque now - may have a work around.
Thanks again.
-
Also: Iv got:
<input type="image" src="/images/cancel.jpg" name="cancel" id="cancel" value="Cancel" onClick="Javascript:window.close();" />
Line 159 column 132: there is no attribute "onClick".
So how would i close the window with a button otherwise?
-
Not sure if this is the right place to post, so I apologise in advance.
Iv been using: http://validator.w3.org to validate my HTML (HTML but im using php...)
Its throwing a wobbley because the id="title" of an input box has the same id as another, but this is because its in a php loop. I cant put a numeric variable on the end of it like: id="title1" id="title2" from the loop as Im using AJAX to pick up these values for posting.
Any ideas?
On another note, I have an <a href tag with onmouseover and onlick - but its saying this is an error too - but dont understand why?
Im very sloppycode, so any understanding of this would be appreciated.
-
Iv always said "If in doubt, float it left"!
Iv always found the following useful:
http://www.webreference.com/authoring/style/sheets/layout/advanced/
But if you are using Dreamweaver to code then you see a list of options as you type.
-
Doesnt matter - I figured it out.
It appears to be a width issue with some of the div's
-
Hi, the real site is hidden behind a htaccess.
Iv stripped the code into an example: http://hardbyte.com/test/test.php
It appears that the above example is not working in IE6 or IE7 now - only firefox gets away with it?
-
Hey,
Coding in css & loadsa div's - got boxes etc.. like a sort of blog with comments/posted by and posted date.
Firefox and IE7 works fine - however in IE6 it repeats part of the "posted by" div. So the layout is fine, but then you have a random few characters from another div printed directly underneath.
Bit hard to explain... Anyone know what Im going on about? Bit like:
<div1>
Comments go here
<div2>posted date: 2007-02-02</div2><div3>Posted by: matfish</div3>
</div1>
by: matfish <- this being the repeated text from div3 above
Age calculation
in Javascript Help
Posted
Hi, Many thanks!
With the above, Im now able to pass the variables of dd-mm-yyyy through another script to calc the age.
Thanks