How to find out if ANY user has posted today

bryce alvord Posted in Component Development 6 years ago

How would I find out if any user at all has posted specifically on the Wall today? If this means writing a stored proc I am fine with that but could use some help understanding the schema and how to call a proc from the code. Thanks!

Replies
gb Rishi B Replied 6 years ago

@Arsalan, no offense intended, but I understand very well how SQL works. The point of having an open source product is to allow developers to experiment with what works and learn how the system works through their own experimentation.

All I did was posted a select query. I didn't suggest anyone actually modify the database in any way, I understand that can cause problems (especially for someone who isn't very familiar with how MySQL interacts with PHP, etc. - I think you know by now that this does not apply to a fairly seasoned developer like myself).

Bryce, if you don't feel comfortable running a select query on your own db server, then don't.

Indonesian Arsalan Shah Replied 6 years ago

@bansh, Please don't do direct sql queries on ossn, there are many reasons behind,

gb Rishi B Replied 6 years ago

if you just want to run it as a separate SQL query (i.e. not from within the ossn framework, maybe in a shell script or something), you could use: SELECT * FROM ossn_object WHERE subtype="wall" AND DATE("time_created") = CURDATE();

that should get you all wall posts created today, if you want the total number, you can count the # of rows returned.

Indonesian Arsalan Shah Replied 6 years ago

See

$wall       = new OssnWall;
$posts = $wall->getAllPosts(array(
        'type' => 'user',
        'distinct' => true,
        'wheres' => array('set here sql check for variable o.time_created'),
));
Premium Version

Due to the many requests in the past for additonal features and components we have decided to develope a premium version. Features like Hashtags, Videos, Polls, Events, Stories, Link Preview, etc included in it.

$199 (Life Time)
Learn More

Other Questions