Welcome to Geeklog, Anonymous Tuesday, November 05 2024 @ 07:15 am EST
Geeklog Forums
Members View Real-Time Postings, Guests Only View Old Postings...
TBG
Anonymous
Hello,
Members of the site will be able to view real-time stories as
they are posted and guests will only be able to view 7 day old data, stories. Do you know of a plugin that will do this or do you know of an easy way to adjust the PHP code to make this happen? Thanks.
Members of the site will be able to view real-time stories as
they are posted and guests will only be able to view 7 day old data, stories. Do you know of a plugin that will do this or do you know of an easy way to adjust the PHP code to make this happen? Thanks.
4
5
Quote
TBG
Anonymous
I added this to my index.php and now that functionality is working. Let me know of any comments or feedback. Thank you.
// These statements below allows only members of the site to view the stories as
// they are posted. Guest view stories that have been posted x days ago (in this
// case it's 7 days).
if ($_USER['uid']>1) {
$sql = "FROM {$_TABLES['stories']} WHERE (date } else {
$sql = "FROM {$_TABLES['stories']} WHERE (date }
// These statements below allows only members of the site to view the stories as
// they are posted. Guest view stories that have been posted x days ago (in this
// case it's 7 days).
if ($_USER['uid']>1) {
$sql = "FROM {$_TABLES['stories']} WHERE (date } else {
$sql = "FROM {$_TABLES['stories']} WHERE (date }
9
5
Quote
TBG
Anonymous
Sorry, here is the full code:
// These statements below allows only members of the site to view the stories as
// they are posted. Guest view stories that have been posted x days ago (in this
// case it's 7 days).
if ($_USER['uid']>1) {
$sql = "FROM {$_TABLES['stories']} WHERE (date } else {
$sql = "FROM {$_TABLES['stories']} WHERE (date }
// These statements below allows only members of the site to view the stories as
// they are posted. Guest view stories that have been posted x days ago (in this
// case it's 7 days).
if ($_USER['uid']>1) {
$sql = "FROM {$_TABLES['stories']} WHERE (date } else {
$sql = "FROM {$_TABLES['stories']} WHERE (date }
4
6
Quote
TBG
Anonymous
Last time: here it is, sorry. I needed to post in Text Mode.
// These statements below allows only members of the site to view the stories as
// they are posted. Guest view stories that have been posted x days ago (in this
// case it's 7 days).
if ($_USER['uid']>1) {
$sql = "FROM {$_TABLES['stories']} WHERE (date <= NOW()) AND (draft_flag = 0)";
} else {
$sql = "FROM {$_TABLES['stories']} WHERE (date <= DATE_SUB(NOW(),INTERVAL 7 DAY)) AND (draft_flag = 0)";
}
// These statements below allows only members of the site to view the stories as
// they are posted. Guest view stories that have been posted x days ago (in this
// case it's 7 days).
if ($_USER['uid']>1) {
$sql = "FROM {$_TABLES['stories']} WHERE (date <= NOW()) AND (draft_flag = 0)";
} else {
$sql = "FROM {$_TABLES['stories']} WHERE (date <= DATE_SUB(NOW(),INTERVAL 7 DAY)) AND (draft_flag = 0)";
}
7
6
Quote
All times are EST. The time is now 07:15 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content