| |
| |
|
|
|
|
| |
|
| |
|
| :: |
| Author |
Message |
mikey67
Joined: 26 Oct 2006 Posts: 6
|
Posted: Wed Nov 15, 2006 1:50 pm Post subject: journal hack for phpbb |
|
|
hello all, please advice for this
there was on phpbbhacks a hack that would make a journal for every member. I am notice that the download is now gone??
I have the code used
Do ye see anything wrong or bad with this coding
| Code: |
##############################################################
## MOD Title: Journal Forum Mod
## MOD Author: IDB < ian@errolian.com > (Ian Brooks) http://www.team-allegiance.com
## MOD Description: Mod to allow a Journal forum on your site, where only the topic starter
## can reply to his own topic, and only 1 Journal topic can be started per user.
## MOD Version: 0.1.0
##
## Installation Level: Moderate
## Installation Time: 15 Minutes
## Files To Edit: posting.php, constants.php, lang_main.php
## Included Files: n/a
##############################################################
## Author Notes: Update all lang_main.php files for installed languages.
## Set-up a new forum to be used as a Journal forum and identify the forum number.
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN]------------------------------------------
#
lang/.../lang_main.php
#
#-----[ FIND ]------------------------------------------
#
//
// That's all Folks!
#
#-----[ ADD BEFORE ]------------------------------------------
#
$lang['Journal_reply_message'] = "Only thread starters can reply to their threads in the Journals forum<BR>";
$lang['Journal_topic_message'] = "Only one journal per user is allowed in the Journals forum<BR>";
#
#-----[ FIND ]------------------------------------------
#
//
// That's all Folks!
#
#-----[ SAVE ]------------------------------------------
#
lang/.../lang_main.php
#
#-----[ OPEN]------------------------------------------
#
includes/constants.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ ADD BEFORE ]------------------------------------------
#
//Journal Forum Definition
define('FORUM_WEBLOGS', XX);
NOTE: Change the XX to the Forum ID of the Forum you are setting up as a Journal Forum
#
#-----[ SAVE ]------------------------------------------
#
includes/constants.php
#
#-----[ OPEN]------------------------------------------
#
posting.php
#
#-----[ FIND ]------------------------------------------
#
switch( $mode )
{
case 'newtopic':
$redirect = "mode=newtopic&" . POST_FORUM_URL . "=" . $forum_id;
break;
case 'reply':
case 'topicreview':
$redirect = "mode=reply&" . POST_TOPIC_URL . "=" . $topic_id;
break;
case 'quote':
case 'editpost':
$redirect = "mode=quote&" . POST_POST_URL ."=" . $post_id;
break;
}
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
header($header_location . append_sid("login.$phpEx?redirect=posting.$phpEx&" . $redirect, true));
exit;
}
#
#-----[ ADD AFTER ]------------------------------------------
#
$journal_exit_msg = "<BR>Return to the <a href=" . append_sid("index.$phpEx",true) . ">Index</a><BR>";
if ( ($forum_id == FORUM_WEBLOGS) && ($mode == 'reply' || $mode == 'quote') ) {
$sql = "SELECT poster_id FROM " . POSTS_TABLE . " WHERE forum_id = " . $forum_id . " AND topic_id = " . $topic_id ;
if (!($result = $db->sql_query($sql))) {
message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
}
while( $row = $db->sql_fetchrow($result) ) {
$topic_poster = $row['poster_id'];
}
if ( ($topic_poster != $userdata['user_id']) ) {
message_die(GENERAL_MESSAGE, $lang['Journal_reply_message'] . $journal_exit_msg);
}
}
if ( ($forum_id == FORUM_WEBLOGS) && ($mode == 'newtopic') ){
$sql = "SELECT * FROM " . TOPICS_TABLE . " WHERE forum_id = " . $forum_id . " AND topic_poster = " . $userdata['user_id'] ;
//exit($sql);
if ($result = $db->sql_query($sql)) {
$journal_num = $db->sql_numrows($result);
if ($journal_num > 0) {
message_die(GENERAL_MESSAGE, $lang['Journal_topic_message'] . $journal_exit_msg);
}
}
}
#
#-----[ SAVE ]------------------------------------------
#
posting.php
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
|
|
|
|
| Back to top |
|
 |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 15242
|
Posted: Wed Nov 15, 2006 6:29 pm Post subject: Re: journal hack for phpbb |
|
|
Simple indeed.
Interesting, the code looks ok, but the code asked for to find is quite old, so I am not 100% sure it will work.
Anyway, if you want to give a try on a local test server, I think the code to find in posting.php is now :
| Code: | switch( $mode )
{
case 'newtopic':
$redirect = "mode=newtopic&" . POST_FORUM_URL . "=" . $forum_id;
break;
case 'reply':
case 'topicreview':
$redirect = "mode=reply&" . POST_TOPIC_URL . "=" . $topic_id;
break;
case 'quote':
case 'editpost':
$redirect = "mode=quote&" . POST_POST_URL ."=" . $post_id;
break;
}
redirect(append_sid("login.$phpEx?redirect=posting.$phpEx&" . $redirect, true));
} |
The redirect() function did not exist by the time of the mod, which makes it very old. It's principle though is this simple it could still work, no big deal to give a try.
++ |
_________________ Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________
Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche |
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 15242
|
|
| Back to top |
|
 |
nims phpBB SEO Team

Joined: 11 Oct 2006 Posts: 243 Location: New Delhi, India
|
Posted: Tue Nov 21, 2006 6:05 am Post subject: Re: journal hack for phpbb |
|
|
Hey looks cool to me. I guess it wud be suitable for my forum too
I can provide Journal to the Models to display their profile. |
_________________ Audio Ads - Earn from every visitor to your site
Buy Latest mobiles *** SEO India |
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 15242
|
|
| Back to top |
|
 |
nims phpBB SEO Team

Joined: 11 Oct 2006 Posts: 243 Location: New Delhi, India
|
Posted: Tue Nov 21, 2006 12:28 pm Post subject: Re: journal hack for phpbb |
|
|
After actually installing it I realised that it wud be really dumb to display the profile / pics etc. without other people being able to comment on it. So, though I have installed it , but I guess I am not yet convinced to use it.  |
_________________ Audio Ads - Earn from every visitor to your site
Buy Latest mobiles *** SEO India |
|
| Back to top |
|
 |
|
|
| Navigation |
Similar Topics |
|
|
|
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |