Yeah I think the use of custom fields would be needed, since how are you going to assign a thumbnail to a post? Also, how are the related posts determined, by category, tag etc. I can try and give you a hand if I can get this information.
Yeah I think the use of custom fields would be needed, since how are you going to assign a thumbnail to a post? Also, how are the related posts determined, by category, tag etc. I can try and give you a hand if I can get this information.
Its pretty cool but I tend to open a lot of tabs while on Facebook and im pretty convinced that its crashing my browser :P
Nice article Scrivs, just reading it now
Now, I know why most people compress they're js files, because they don't won't people to steal the code, but it must be the case that sometimes, like what happened to me today, you've just gotta crack that encryption. I'm a bit worried about posting this, so I hope it's in someway new and/or useful.
Basically we need to go into a js file that was given to us, in order to change a few DOM-based functions. I opened up the file, and lo and behold, this was the first few characters...
eval(function(p,a,c,k,e,d){...
This is the trademark sign of the packer by Dean Edwards. I'd seen this a few more times, and used it myself too, but never had to decode it before. So I did a little searching and found a nice method of decoding it:
So yeah, that's how to decode the p,a,c,k,e,r compressor. Hope this is useful :)
At the moment using Firefox for browsing, Opera for feeds and web galleries sites (love that speed dial) and IE for constructive swearing. Yum.
Wow thanks for that stuff Oli, never delved into regex much so far, that's helped me a lot. To be fair to this client she is our biggest job in years, so we're pulling out all the stops.
The responses I feared :( Ah well, thanks for the input, might try using Regex, event if I can get the values out it will be a GREAT SUCCESS!
Think I might just say to her 'Do it yourself love!'. At least I wasn't alone in thinking the whole idea is bonkers.
Don't think I've explained myself very well, the field in question will contain text, be it lists, paragraphs, anything, it's not feesible to say 'special offers prices here' since there will be text accompanying it, and there may not be any prices. It's just if there is, they need to be converted on the fly. Some properties do not have special offers, then this field left blank.
The function needs to go into the text and find any occurences of a price in $ and convert it to £. The rate is defined elsewhere, thats done and dusted.
There, that got you attention.
I've got a (annoying) client that I'm making a Caribbean property website. She has the functionality to manage the $ to £ and $ to Euro conversion rates, and she only enters the prices in $ in the admin. For the normal pricing section this isn't a problem, since there are individual fields, so conversion is easy.
The problem is the special offers part for each property, since this has to be text so she can be whatever she wants in these fields. But she is insisting on entering the price in $ but wants them to appear in £ on the front-end.
See why she's annoying? I've been looking at the PHP functions such as strpos, strstr, str_replace trying to find a way to automate this.
Basically I'm trying to develop a function that takes a string input and converts all $ prices into £ Sterling. Any ideas would be appreciated, since you're such a helpful lot :)
Here's an example of the type of text in there (I'm moving it all from an older ASP .NET site):
Special Offer:
SPRING SALE
Book before 30 April for travel between 01 March - 31 July 2008.
01-30 April
Standard room £93.00
Deluxe Pool/Gdn View £102.00
Superior Dlxe Pool/Gdn £110.00
1 -31 May
Standard room £85.00
Deluxe Pool/Gdn View £93.00
Superior Dlxe Pool/Gdn £102.00
1 June-31 July
Standard room £80.00
Deluxe Pool/Gdn View £87.00
Superior Dlxe Pool/Gdn £97.00
All prices are per person per night.
Hmm well I can confirm for you definitely does not work on my IE7 either :(
Not very familiar with the
I don't reckon there's an attribute called blog.littlerockjams :)
Try re-copying the code, because that < bit is code for < right?, maybe it should be more like:
Or maybe that image shouldn't have been there at all, and the classid attribute should match something else/
Hope I've hit on something here :) good luck.
Edit: The code bit of this editor doesnt like me, not showing up the way it should, so view the source at Line 512 here to see what i meant.
I was thinking about this while coding my current project, a property website, and adding a few things to my utility.php file. There are couple of little tidbits/snippets that I've come up with which I could definitely not do without that I've come up with myself (i.e. are not built-in)
I was wondering if anyone else was willing to share theirs, regardless of your programming languange :)
Here's one of my more simple ones ... okay it's not at all impressive, but it saves me a good deal of time when creating/testing a system. It always annoyed me how the php function print_r() was always displayed in a huge inline fashion, and I had to wrap
tags everytime I wanted to make sense of it, so I made:
function print_p($arr)
{
echo '';';
print_r($arr);
echo '
}
?>Like I said, just a simple example, don't scold me for it's simplicity :)
I've been told many times that the whole 'teeth falling out' dream relates to anxiety or nerves. My whole family get this dream when they have big appointments, or in my case rugby matches, the next day.
Does sound a lot like Freeman doesn't it?
Good on you for sharing this mate, quite a magical video.
Just wondering if anyone knows if there is any tool for Safari similar to Firebug for Firefox. Specifically the HTML console which updates live when javascript is running etc. Any help would be really appreciated :)
(Ah my bad, wrong community! can someone move this if possible? thanks :P )
» Related post plugin? ... Last Reply: 7 months ago by ldragon.
Thing about tags is there could be multiple tags per post, so how should the system decided which tag to use to get related posts?
But I've tried to come up with something, keep in mind this with version 2.5+ . Whilst you're in the loop for the single post, put this bit of code in there somewhere:
$tags = get_the_tags();$related_tag = array_shift($tags);
?>
$related_tag is now an object which contains information on the first tag of the post.
Now what you do is setting up a query_posts function using the tag information wherever you want the related posts to appear. query_posts does act funny sometimes, so this may not work, but I've tested it and it worked on by system. Anyway, you need to put this code in:
$str = 'tag='.$related_tag->name;$str.= '&showposts=5';
query_posts($str);
while(have_posts()) { the_post();
### loop things in here e.g. the_title(), the_content()
}
?>
The string we send to the function read like this: tag=cooking&showposts=5. So this finds posts matched to that tag and returns the first first.
If you do have multiple tags, you can make the function search for 'posts with any of these tags', but the query you send to the function is slightly different:
$str = 'tag=';foreach($array as $tag)
{
$str .= $tag->name.',';
}
$str = substr($str,0,-1);
$str.= '&showposts=5';
query_posts($str);
while(have_posts()) { the_post();
### loop things in here
}
?>
This loops through each format and write the query string like this: tag=bread,butter,jam&showposts=5.
In theory this should work. There are other functions to look for posts with, which I tend to use, such as get_posts() and the WP_Query object, but you can search for tags using them.
If you need to put other parameters into the function, this page tells all about the parameters.
Hope that works, and helps :)