darrenbale's Profile
Reputation: 42
Excellent
- Group:
- Members
- Active Posts:
- 900 (0.86 per day)
- Joined:
- 01-April 09
- Profile Views:
- 15,832
- Last Active:
Yesterday, 11:34 PM- Currently:
- Searching...
My Information
- Member Title:
- God of Javology
- Age:
- 29 years old
- Birthday:
- June 9, 1982
- Gender:
-
Male
- Location:
- Auckland, NZ
- Interests:
- Armed Forces, Keep fit, Web designing, Computing, XBOX360, My daughters.
Contact Information
- E-mail:
- Click here to e-mail me
- Website URL:
-
http://www.dpbcreations.co.uk
Users Experience
- Experience:
- Intermediate
- Area of Expertise:
- Web Designer
Latest Visitors
-
francine87 
06 Jan 2012 - 02:38 -
Weeeb Store d... 
26 Oct 2011 - 05:07 -
Sam G 
18 Oct 2011 - 11:07 -
wimarie 
07 Sep 2011 - 15:46 -
Dan_Santy 
29 Jun 2011 - 20:36
Topics I've Started
-
Wordpress issues.
26 October 2011 - 01:13 AM
Hi Guys,
I need a little help with a wordpress site that has been built by someone else using plugins and a theme bought from somewhere. (not sure where it was got from and guy who installed it can't remember either)
Anyways,
The site is a property list basically.
On the main properties page, it is supposed to show all unsold properties sorted by newest first and then followed by all sold properties.
Here is the code that selects the posts:
<?php $post = $wp_query->post; $show = get_settings($shortname."_homePostCategory"); $limit = get_settings('posts_per_page'); $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts('cat=-42&showposts='.$limit.'&paged=' .$paged.'&meta_key=issold&orderby=post_id&order=DESC'); $wp_query->is_archive = true; $wp_query->is_home = false; ?>
Query it creates is
SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id) WHERE 1=1 AND ( wp_posts.ID NOT IN ( SELECT object_id FROM wp_term_relationships WHERE term_taxonomy_id IN (42) ) ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') AND wp_postmeta.meta_key = 'issold' GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 10
But instead of doing what it should, it instead sorts everything by post_id, so we get some unsold, then a sold, then some more unsold etc.
I need some way to add an additional order by to this query, so it becomes more like
SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id) WHERE 1=1 AND ( wp_posts.ID NOT IN ( SELECT object_id FROM wp_term_relationships WHERE term_taxonomy_id IN (42) ) ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') AND wp_postmeta.meta_key = 'issold' GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC, wp_postmeta.meta_key DESC
Does anyone know how I can do this?
Cheers -
stripping variables from querystring
24 September 2011 - 09:19 PM
Hi guys,
Need a little help. My brain just isn't functioning right now.
I have a url that looks something like http://www.thesite.com/?ref=AbcD1234
Stripping and using the AbcD1234 is no issue and is working if the url is as above, but now I need to be able to remove the ?ref=AbcD1234 where the url may be in the format http://www.thesite.c...f=AbcD1234/blah or http://www.thesite.c...ef=Abcd1234<img src=
etc etc etc.
I can't just match on string length as the number of letters and numbers is changeable, I also can't match based on case as some will be uppercase, some lowercase and some camelcase as per my example. The only constant is that the ref will always be letters followed by numbers.
Also this has to be done in php and not in htaccess.
Anybody got any ideas?
Cheers -
Help needed with a script
17 August 2011 - 12:35 AM
Hi guys,
I need some help with a script. I just cannot get it too work and can't see why. It was written by somebody else and he is no longer available to help with fixing it.
Here is the code:
//CHECK FOR WINS FUNCTION function check_for_wins() { $STdb = mysql_connect("localhost","xxxx","xxxx"); // All types of report rely on selecting lines for active syndicates only // Match "$n" balls from $line in $balls. If $mustMatch1/2 are specified, $line must contains $mustMatch1/2 etc. function testLine($line, $balls, $n, $mustMatch1 = null, $mustMatch2 = null) { // echo "testLine: Testing " . implode(", ", $line) . " against " . implode("-", $balls) . ". Must have $n matches\n"; if ($mustMatch1 && !in_array($mustMatch1, $line)) { return false; } if ($mustMatch2 && !in_array($mustMatch2, $line)) { return false; } $matchCount = 0; // Go through every number in this line for ($li = 0; $li < count($line); $li++) { // If it's not in the list of balls, skip over it if (!in_array($line[$li], $balls)) { // echo "{$line[$li]} is not in the array, skipping\n"; continue; } // echo "{$line[$li]} is in the array, hurrah!\n"; // See if we've reached the count of matches required by this test $matchCount++; // echo "\$matchCount is now $matchCount\n"; if ($matchCount == $n) { // echo "WE HAVE A WINNAR\n"; return true; } } // echo "YOU FAIL IT\n"; return false; } function testEuroMillions() { $syndicateR = mysql_query("select distinct syndicate from v_syndicate_members"); $syndicateRS = mysql_fetch_array($syndicateR); if (!$syndicateRS) { die("Couldn't select active syndicates"); } $syndicateList = array(); foreach ($syndicateRS as $row) { $syndicate = $row['syndicate']; if ($syndicate) { $syndicateList[] = $syndicate; } } $syndicateIn = implode(", ", $syndicateList); $ballRS = mysql_query("select * from draw_results order by draw_date DESC LIMIT 1"); if (!$ballRS) { return false; } $num=mysql_numrows($ballRS); if($num >= 1) { $i=0; while ($i < $num) { while ($ballRow = mysql_fetch_assoc($ballRS)) { $date = $ballRow['draw_date']; $balls = array($ballRow['number1'],$ballRow['number2'],$ballRow['number3'],$ballRow['number4'],$ballRow['number5']); $stars = array($ballRow['star1'],$ballRow['star2']); $ballList = implode("-", $balls); $ballIn = implode(",", $balls); $lineRS = mysql_query("select * from syndicate_lines where (number1 in ($ballIn) or number2 in ($ballIn) or number3 in ($ballIn) or number4 in ($ballIn) or number5 in ($ballIn)) and syndicate in ($syndicateIn)"); if (!$lineRS) { continue; } $num=mysql_numrows($lineRS); if($number >= 1) { $e=0; while ($e < $number) { while ($lineRow = mysql_fetch_assoc($lineRS)) { $line = array($lineRow['number1'], $lineRow['number2'], $lineRow['number3'], $lineRow['number4'], $lineRow['number5']); $lineStars = array($lineRow['star1'], $lineRow['star2']); $lineList = implode("-", $line) . "-{$lineStars[0]}-{$lineStars[1]}"; $syndicate = $lineRow['syndicate']; if (testLine($line, $balls, 5) && testLine($lineStars, $stars, 2)) { mysql_query("INSERT IGNORE INTO winning_lines (draw_date,syndicate,syndicate_line,win_rank,win_type,draw_line) VALUES ('$date','$syndicate','$lineList','r99','5b_2s','$ballList-{$stars[0]}-{$stars[1]}')"); continue; } if (testLine($line, $balls, 5) && testLine($lineStars, $stars, 1)) { mysql_query("INSERT IGNORE INTO winning_lines (draw_date,syndicate,syndicate_line,win_rank,win_type,draw_line) VALUES ('$date','$syndicate','$lineList','r95','5b_1s','$ballList-{$stars[0]}-{$stars[1]}')"); continue; } if (testLine($line, $balls, 5)) { mysql_query("INSERT IGNORE INTO winning_lines (draw_date,syndicate,syndicate_line,win_rank,win_type,draw_line) VALUES ('$date','$syndicate','$lineList','r90','5b','$ballList-{$stars[0]}-{$stars[1]}')"); continue; } if (testLine($line, $balls, 4) && testLine($lineStars, $stars, 2)) { mysql_query("INSERT IGNORE INTO winning_lines (draw_date,syndicate,syndicate_line,win_rank,win_type,draw_line) VALUES ('$date','$syndicate','$lineList','r85','4b_2s','$ballList-{$stars[0]}-{$stars[1]}')"); continue; } if (testLine($line, $balls, 4) && testLine($lineStars, $stars, 1)) { mysql_query("INSERT IGNORE INTO winning_lines (draw_date,syndicate,syndicate_line,win_rank,win_type,draw_line) VALUES ('$date','$syndicate','$lineList','r80','4b_1s ','$ballList-{$stars[0]}-{$stars[1]}')"); continue; } if (testLine($line, $balls, 4)) { mysql_query("INSERT IGNORE INTO winning_lines (draw_date,syndicate,syndicate_line,win_rank,win_type,draw_line) VALUES ('$date','$syndicate','$lineList','r75','4b','$ballList-{$stars[0]}-{$stars[1]}')"); continue; } if (testLine($line, $balls, 3) && testLine($lineStars, $stars, 2)) { mysql_query("INSERT IGNORE INTO winning_lines (draw_date,syndicate,syndicate_line,win_rank,win_type,draw_line) VALUES ('$date','$syndicate','$lineList','r70','3b_2s','$ballList-{$stars[0]}-{$stars[1]}')"); continue; } if (testLine($line, $balls, 3) && testLine($lineStars, $stars, 1)) { mysql_query("INSERT IGNORE INTO winning_lines (draw_date,syndicate,syndicate_line,win_rank,win_type,draw_line) VALUES ('$date','$syndicate','$lineList','r65''3b_1s','$ballList-{$stars[0]}-{$stars[1]}')"); continue; } if (testLine($line, $balls, 2) && testLine($lineStars, $stars, 2)) { mysql_query("INSERT IGNORE INTO winning_lines (draw_date,syndicate,syndicate_line,win_rank,win_type,draw_line) VALUES ('$date','$syndicate','$lineList','r60','2b_2s','$ballList-{$stars[0]}-{$stars[1]}')"); continue; } if (testLine($line, $balls, 3)) { mysql_query("INSERT IGNORE INTO winning_lines (draw_date,syndicate,syndicate_line,win_rank,win_type,draw_line) VALUES ('$date','$syndicate','$lineList','r55','3b','$ballList-{$stars[0]}-{$stars[1]}')"); continue; } if (testLine($line, $balls, 1) && testLine($lineStars, $stars, 2)) { mysql_query("INSERT IGNORE INTO winning_lines (draw_date,syndicate,syndicate_line,win_rank,win_type,draw_line) VALUES ('$date','$syndicate','$lineList','r50','1b_2s','$ballList-{$stars[0]}-{$stars[1]}')");; continue; } if (testLine($line, $balls, 2) && testLine($lineStars, $stars, 1)) { mysql_query("INSERT IGNORE INTO winning_lines (draw_date,syndicate,syndicate_line,win_rank,win_type,draw_line) VALUES ('$date','$syndicate','$lineList','r45','2b_1s','$ballList-{$stars[0]}-{$stars[1]}')"); continue; } if (testLine($line, $balls, 2)) { mysql_query("INSERT IGNORE INTO winning_lines (draw_date,syndicate,syndicate_line,win_rank,win_type,draw_line) VALUES ('$date','$syndicate','$lineList','r40','2b','$ballList-{$stars[0]}-{$stars[1]}')"); continue; } $e++; } } } $i++; } } }} testEuroMillions(); mysql_close($STdb); }
Can anybody see what is wrong? There are no errors displayed on screen. I know the database connection is correct (although I've xxxx the user and pass here obviously)
It gets a list of syndicates, but appears to loop through the results but doesn't ever add anything to the database. There is a syndicate with a line that is 1,2,3,4,5,6,7 and a set of results that are 1,2,3,4,5,6,7 so it should get a list one matching line.
Any help would be greatly appreciated as I am tearing my hair out with this one.
Cheers -
Font identification help needed
06 July 2011 - 02:40 AM
Hi guys, I need some help identifying a font. I've tried what the font, identifont etc but have had no joy.
Failing being able to identify it, does anybody think they could reproduce the word fosters to match it?
Cheers
Help




Find My Content
Display name history



Comments
darrenbale
16 Aug 2010 - 12:30I'm always around on email though.
dmpinder
16 Aug 2010 - 12:25Sean D
30 Jun 2010 - 14:10Just in Brockhill myself, where abouts are you?
Yeah I noticed, pretty weird on one forum!
Ollie Read
29 Jun 2010 - 16:03The pint idea sounds good, I'll be going fully self employed soon, so my time will be free up :) lol
Ollie Read
29 Jun 2010 - 12:42Ollie Read
16 Jun 2010 - 15:09Nice to see someone else from Redditch :D
And I know Traxor, quite well actually aha
:D
Lev
09 Feb 2010 - 16:16darrenbale
02 Oct 2009 - 23:37christian21
02 Oct 2009 - 23:36What did you do in the forces?
Just curious.
Christian