TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 07-03-2009, 02:33 PM   #1 (permalink)
The Visitor
 
yoav's Avatar
 
Join Date: Jul 2009
Location: Israel
Posts: 3
Thanks: 2
yoav is on a distinguished road
Default need help tweeking a sweetcron site

hi,

i installed sweetcron on my site to function as my blog and what im trying to do is make it that my front page always shows the most recent blog post above the activity feed. so far no luck...

i was wondering if anyone can help me out..

thanks,

yoav
Send a message via Skype™ to yoav
yoav is offline  
Reply With Quote
Old 07-03-2009, 05:56 PM   #2 (permalink)
The Addict
 
Join Date: May 2009
Posts: 287
Thanks: 5
adamdecaf is on a distinguished road
Default

I don't see an API, if they have one it would be the answer to this question.

*EDIT*

Alright This should get you started.
PHP Code:
<?php
// Set the detauls
    
$hostname "db1932.perfora.net";
    
$dbname "db291144085";
    
$username "dbo291144085";
    
$password "qNwx9kTX";
    
// Now grab the lastest item
$connect mysql_connect($hostname$username$password);
    
mysql_select_db($dbname);
    
    
// build the query.
    
$sql "SELECT * FROM items ORDER BY id DESC LIMIT 1";
    
$query mysql_query($sql);
    
    
// Now make it an array
    
$query mysql_fetch_array($queryMYSQL_ASSOC);
    
        
// A Little Debugging
        // print_r($query);
        
    // Now we can take the query and treat it like an array
        
echo "Title: <a href='" $query["item_permalink"] . "'>" $query[item_title] . "</a><br />";
        echo 
"Content: " $query["item_content"] . "<br />";
        echo 
"Time: " $query["item_date"] . "<br />";

?>
A sample response is:
Code:
Array
(
    [ID] => 1
    [item_date] => 1246652528
    [item_content] => Whats up?
    [item_title] => Hello World
    [item_permalink] => 
    [item_status] => publish
    [item_name] => hello-world
    [item_parent] => 0
    [item_data] => a:0:{}
    [item_feed_id] => 0
)
Example: http://open.ashannon.us/junk/sweetcr...-sweetcron.php

*Notes*
I have to give the guy who created this a LOT of credit, he has tons of features. I think that he lost interest or didn't have and visible support so he stopped this project, but it's a great system. I would recommend it if you like the demo.
__________________
My Site

Last edited by adamdecaf : 07-05-2009 at 11:28 PM.
adamdecaf is offline  
Reply With Quote
The Following User Says Thank You to adamdecaf For This Useful Post:
yoav (07-05-2009)
Old 07-05-2009, 08:06 PM   #3 (permalink)
The Addict
 
Join Date: May 2009
Posts: 287
Thanks: 5
adamdecaf is on a distinguished road
Default

Is that guy there, or did I get "scammed" out of helping him? agh...
__________________
My Site
adamdecaf is offline  
Reply With Quote
The Following User Says Thank You to adamdecaf For This Useful Post:
yoav (07-05-2009)
Old 07-05-2009, 08:08 PM   #4 (permalink)
The Addict
 
Enfernikus's Avatar
 
Join Date: Jun 2008
Posts: 335
Thanks: 2
Enfernikus is on a distinguished road
Default

Adamn it's much faster to wrap your array elements in quotes
__________________
My Blog
Enfernikus is offline  
Reply With Quote
Old 07-05-2009, 10:14 PM   #5 (permalink)
The Visitor
 
yoav's Avatar
 
Join Date: Jul 2009
Location: Israel
Posts: 3
Thanks: 2
yoav is on a distinguished road
Default

I'm defiantly here!

the only thing is that i live in israel so with the time differences it sometimes takes me a few hours to reply...

thanks for your solution ill run it on my site and post the results asap!

your the man!

yoav
__________________
Wine Making Portal- Discover Wine Making Tricks & tips
Referrals Directory - Add your Website to the fastest growing referrals directory
My Blog: Yoav Shalev
Send a message via Skype™ to yoav
yoav is offline  
Reply With Quote
Old 07-05-2009, 11:28 PM   #6 (permalink)
The Addict
 
Join Date: May 2009
Posts: 287
Thanks: 5
adamdecaf is on a distinguished road
Default

Quote:
Originally Posted by yoav View Post
I'm defiantly here!

the only thing is that i live in israel so with the time differences it sometimes takes me a few hours to reply...

thanks for your solution ill run it on my site and post the results asap!

your the man!

yoav
Ah, no problem.

Quote:
Originally Posted by Enfernikus View Post
Adamn it's much faster to wrap your array elements in quotes
Hmm, they were quoted on my version. Weird, I will update it.
__________________
My Site
adamdecaf is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pulling values from one site as reference 9three Absolute Beginners 4 02-17-2009 02:37 PM
How to make an RSS aggregator site ? vuthcam Advanced PHP Programming 1 02-03-2009 10:12 PM
How to Login to Any Account on an Insecure Site Wildhoney Tips & Tricks 18 12-14-2008 09:58 PM
Gaming Site Redux obolus Show Off 3 02-25-2008 09:52 PM
Recently rebuilt site obolus Show Off 6 10-30-2007 02:24 AM


All times are GMT. The time now is 01:45 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design