What are you passing into your time_ago function as the compare time?
This is ordinary what DS and I do on MSN all day.
Just got back on the internet after losing my access for a week. Read more on Random Discussion.
What are you passing into your time_ago function as the compare time?
This is ordinary what DS and I do on MSN all day.
I'm not sure how you're doing it currently (all this webspeak gets the better of me) but would it not be easier to have some sort of priority function?
Maybe list posts in ascending order. So the latest post will always be a smaller number and as such, you'll have the latest topics at the top. Then have stickies be extremely low values (0 or, possibly, negative values if it supports that). You can do it in descending order, it makes no difference conceptually.
Maybe I'm overcomplicating though.
In theory Wordpress is supposed to do all of that sorting for you. Why it isn't is beyond me.
Maybe DS broke it. It wouldn't surprise me.
Well, no, I didn't broke it. I used a custom query to sort the posts based on when the latest comments where made (/ when the post was made).
And hey, two loops works well on the front page. The first only takes stickies, and the second only takes non-stickies. Which means I can de-php a few things.
The time_ago thing looks like this:
function time_ago( $type = 'post' ) {
$d = 'comment' == $type ? 'get_comment_time' : 'get_post_time';
return human_time_difference($d( 'U' ), current_time( 'timestamp' ));
}
But I'm pretty sure now that it only looks for posts or comments now...
(human_time_difference is my improvement of WP's human_time_diff function)
[EDIT] Made the code work after some work. Biggest problem was actually setting it if there's no comments made. (Also, timestamps vs. 'U' FFFFFFFFFF)
BUMP!
OK, I thought I'd show this off and see what people thought. Recently, I made a website that loads content from a text file to make it simpler to edit without PHP.
You can see that site here.
Then, I decided to make that into a library that people can include for easy editing action.
Here's what an example text file would look like. (It uses some twisted version of BBCode
)
[main]Header text[/main]
Text
[sub]Subheader text[/sub]
[bold]Bold text[/bold]
[ital]Italic text[/ital]
[img]http://www.huddletogether.com/projects/lightbox2/images/image-2.jpg[/img]
[youtube]http://www.youtube.com/watch?v=ZZV0l8fjwA8[/youtube]
(http://davidlougheed.com/wcmscript/example.txt)
And here's what the page looks like.
http://davidlougheed.com/wcmscript/example.html
What do people think?
I already told you this over WLM, but for what you have to work with it's pretty good. (He told me he can't use PHP on the server.)
My only suggestion would be to make the content area say "You need Javascript enabled to view this page." or something, then erase it with JS as soon as the document loads. Just a thought though, there's nothing wrong with cutting out the .1% of the internet without Javascript.
Actually, your idea is rather cool. But wouldn't it be easier just to use html?
Also, you should check whether or not an element is set to display: inline / inline-block
Just putting br after every line makes display: block elements look dumb.
Thanks DS. The idea of it is so people who are not as good at editing websites could do something a bit easier w/o breaking the layout in DW or the like.
I've gotta say, that's quite interesting. I'm not quite sure what the applications could be just yet, but it seems akin to what Wikipedia does with it's in-built editor.
That being said, some of the codes bug me a little and could be shortened, but that's mainly a preference thing.
Looking at the code, you're using RE a little weirdly for my tastes but it gets the job done. I'm guessing you're hoping to get all of this client-side with a built-in editor on a web-page to show instantaneous results? That would be pretty cool.
Otherwise, if you want to do it server-side, I would suggest the use of Python for the string manipulation (set up a CGI script or something) as it does that really well and cleanly - yes, I'm a sucker for Python.
But anyway, good job!
Python is always a possible php replacement, but to be honest, php is widely supported on the web.
[EDIT] There's tons of cheap servers that supports php, even a few free ones do.
True, but PHP has it's own problems. Mainly security risks, there are patches you can apply but that's extra load on a server.
If you have proper control over the web-server, implementing a python script should be trivial.
Google vehemently supports using Python in web development (a lot of their services use it, YT is a good example).
There's also a few "plugins" that speeds up your server.
But to be fair, no server is truly safe :/
Well when you say PHP has security risks, I think a lot of that is developers who write code without testing for every possible circumstance (injections, etc.). But there probably are some holes in the application as well. Just like servers, well actually just like pretty much anything.
Well, there are some pretty big security risks in PHP if you're planning on making a secure server, ones which allow you to retrieve confidential information.
VideoGuy got me to create this masterpiece: http://i.imgur.com/BIG0N.png
The whole sidebar is static at the moment, but could easily be made dynamic. Critique is appreciated, as we have enough time to update it if any of you dislike anything about it.
Looks good, a pretty advanced web application. It'd be easier if we could see it at work, but I trust you've done an excellent job, as always.
Looks clean, that's good.
Looks good, a pretty advanced web application. It'd be easier if we could see it at work, but I trust you've done an excellent job, as always.
That would be somewhat possible if co.cc and 000webhost worked together to troll VideoGuy.
But hey, if you setup apache with mysql and php you could try it offline
@WJUK: Thanksies!
Yeah, there's a whole story behind that site... a series of mistakes led to it being completely deleted, so now I'm attempting to reload it from Google Cache...
You must log in to post.