similair topic mod
Forumsregeln
Auch wenn hier der Support für phpBB 2 weiterhin aufrecht erhalten bleibt, weisen wir darauf hin, dass das phpBB 2 nicht mehr offiziell unterstützt und weiterentwickelt wird!
Auch wenn hier der Support für phpBB 2 weiterhin aufrecht erhalten bleibt, weisen wir darauf hin, dass das phpBB 2 nicht mehr offiziell unterstützt und weiterentwickelt wird!
similair topic mod
I asked this already elsewhere, but didn't get any answer.
Is there somebody using similari topic mod?
because I found a bug, I contact with writer of mod but didn't get any response.
If you have installed similair topic Mod, and you have some hidden topics, they are shown in the table of similari topics, you can't acess to it, but you can see title.
Is there a way to repair this bug?
Is there somebody using similari topic mod?
because I found a bug, I contact with writer of mod but didn't get any response.
If you have installed similair topic Mod, and you have some hidden topics, they are shown in the table of similari topics, you can't acess to it, but you can see title.
Is there a way to repair this bug?
TNX!
If anyone else will use this mod maybe will do something about this bug.
I uninstalled this mod because of that.
And this mod is not so good because it combine very differend topics together.
I think it looks only for topics names.
Maybe in future if you like to write a new better mod.
If anyone else will use this mod maybe will do something about this bug.
I uninstalled this mod because of that.
And this mod is not so good because it combine very differend topics together.
I think it looks only for topics names.
Maybe in future if you like to write a new better mod.
Zuletzt geändert von Blisk am Di 20.Jun, 2006 15:57, insgesamt 2-mal geändert.
maybe you search for this:
http://www.phpbb.de/viewtopic.php?t=109598
//edit:
one little modification is necessary for my board
@oxpus:
which values are possible for topic_status?
'1' :
??
'2' : moved topics?
....
http://www.phpbb.de/viewtopic.php?t=109598
//edit:
one little modification is necessary for my board
Code: Alles auswählen
*****
find
*****
$sql = "SELECT t.*, u.user_id, u.username, f.forum_id, f.forum_name, p.post_time, p.post_username
FROM ". TOPICS_TABLE ." t, ". USERS_TABLE ." u, ". FORUMS_TABLE ." f, ". POSTS_TABLE ." p
WHERE t.topic_id <> $topic_id $forums_auth_sql
AND MATCH (t.topic_title) AGAINST ('" . addslashes($topic_title) . "')
AND f.forum_id = t.forum_id
AND p.post_id = t.topic_last_post_id
AND t.topic_poster = u.user_id
GROUP BY t.topic_id
ORDER BY t.topic_last_post_id DESC LIMIT 0,5";
*****
replace with
*****
$sql = "SELECT t.*, u.user_id, u.username, f.forum_id, f.forum_name, p.post_time, p.post_username
FROM ". TOPICS_TABLE ." t, ". USERS_TABLE ." u, ". FORUMS_TABLE ." f, ". POSTS_TABLE ." p
WHERE t.topic_id <> $topic_id $forums_auth_sql
AND MATCH (t.topic_title) AGAINST ('" . addslashes($topic_title) . "')
AND f.forum_id = t.forum_id
AND p.post_id = t.topic_last_post_id
AND t.topic_poster = u.user_id
AND t.topic_status <> " . TOPIC_MOVED . "
GROUP BY t.topic_id
ORDER BY t.topic_last_post_id DESC LIMIT 0,5";which values are possible for topic_status?
'1' :
'2' : moved topics?
....
Zuletzt geändert von diegoriv am Do 22.Jun, 2006 10:04, insgesamt 2-mal geändert.
[center]***********************************************************
Alpinum.at - Forum f?r Bergfreunde
***********************************************************[/center]
Alpinum.at - Forum f?r Bergfreunde
***********************************************************[/center]
- oxpus
- Administrator
- Beiträge: 28735
- Registriert: Mo 27.Jan, 2003 22:13
- Wohnort: Bad Wildungen
- Kontaktdaten:
Watch your includes/constants.php:
It's alltimes better to use these constants and NOT hard code the values!
Code: Alles auswählen
// Topic status
define('TOPIC_UNLOCKED', 0);
define('TOPIC_LOCKED', 1);
define('TOPIC_MOVED', 2);
Zuletzt geändert von oxpus am Do 22.Jun, 2006 09:51, insgesamt 1-mal geändert.
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
[quote="oxpus";p="61032"]It's alltimes better to use these constants and NOT hard code the values![/quote]
i changed in this way - is it correct?
Code: Alles auswählen
AND t.topic_status <> " . TOPIC_MOVED . "[center]***********************************************************
Alpinum.at - Forum f?r Bergfreunde
***********************************************************[/center]
Alpinum.at - Forum f?r Bergfreunde
***********************************************************[/center]
Soooooo, what do I have to do to not show unauthorized topics?
This?
http://www.oxpus.de/viewtopic.php?p=61007#61007
This?
http://www.oxpus.de/viewtopic.php?p=61007#61007
Real men don’t back up, they learn data recovery. ;-)
http://www.mysqldumper.de
http://www.mysqldumper.se
http://www.mysqldumper.de
http://www.mysqldumper.se
[quote="diegoriv";p="61033"][quote="oxpus";p="61032"]It's alltimes better to use these constants and NOT hard code the values![/quote]
i changed in this way - is it correct?[/quote]
I didn't test this mod yet, can you tell me if this mod hide topics of hidden forum?
http://www.phpbb.de/viewtopic.php?t=109598
Code: Alles auswählen
AND t.topic_status <> " . TOPIC_MOVED . "I didn't test this mod yet, can you tell me if this mod hide topics of hidden forum?
http://www.phpbb.de/viewtopic.php?t=109598
[quote="Blisk";p="61041"]I didn't test this mod yet, can you tell me if this mod hide topics of hidden forum?
http://www.phpbb.de/viewtopic.php?t=109598[/quote]
yno
this mod checks the authorization from the user or guest and displays topics, corresponding to the auth
http://www.phpbb.de/viewtopic.php?t=109598[/quote]
yno
this mod checks the authorization from the user or guest and displays topics, corresponding to the auth
[center]***********************************************************
Alpinum.at - Forum f?r Bergfreunde
***********************************************************[/center]
Alpinum.at - Forum f?r Bergfreunde
***********************************************************[/center]
[quote="Blisk";p="61100"]NO it doesn't work. User can still see topics of hidden forums.
Can you repair this, or maybe add function to exclude topics or forums for similair topics mod?[/quote]
Did you delete the stars ( /* )
?
read the description!
Can you repair this, or maybe add function to exclude topics or forums for similair topics mod?[/quote]
Did you delete the stars ( /* )
read the description!
Code: Alles auswählen
// If necessary delete the / * to uncomment the block.
/*
// Get forum auth information to insure privacy of hidden topics
//
$forums_auth = auth(AUTH_ALL, AUTH_LIST_ALL, $userdata);
foreach($forums_auth as $k=>$v)
{
if( $v['auth_view'] && $v['auth_read'] )
{
$forums_auth_sql .= (( $forums_auth_sql == '' ) ? '': ', ') . $k;
}
}
if ($forums_auth_sql != '')
{
$forums_auth_sql = ' AND t.forum_id IN (' . $forums_auth_sql . ') ';
}
// Delete the following line, to uncomment this block
*/
Zuletzt geändert von diegoriv am So 25.Jun, 2006 20:46, insgesamt 1-mal geändert.
[center]***********************************************************
Alpinum.at - Forum f?r Bergfreunde
***********************************************************[/center]
Alpinum.at - Forum f?r Bergfreunde
***********************************************************[/center]
[quote="Blisk";p="61191"]Ok, I checked files about 3 times but didn't find this code.
In which file this code should be?[/quote]
:?: :?:
you have made the codechanges posted here: http://www.phpbb.de/viewtopic.php?t=109598
sorry, but cant see the problem. the code ist nearly at the beginning.
In which file this code should be?[/quote]
:?: :?:
you have made the codechanges posted here: http://www.phpbb.de/viewtopic.php?t=109598
sorry, but cant see the problem. the code ist nearly at the beginning.
[center]***********************************************************
Alpinum.at - Forum f?r Bergfreunde
***********************************************************[/center]
Alpinum.at - Forum f?r Bergfreunde
***********************************************************[/center]
aha, sorri, I didn't install that, because I don't know if that is for this MOD I installed.
Can I use this code for this installed mod too?
Can I use this code for this installed mod too?
Code: Alles auswählen
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT topic_id
FROM ". TOPICS_TABLE ."
WHERE topic_id != $topic_id
AND MATCH (topic_title) AGAINST ('". addslashes($topic_title) ."')
ORDER BY topic_time DESC LIMIT 0,5";
#
#-----[ REPLACE WITH ]------------------------------------------
#
$forums_auth_sql = '';
// If necessary delete the / * to uncomment the block.
/*
// Get forum auth information to insure privacy of hidden topics
//
$forums_auth = auth(AUTH_ALL, AUTH_LIST_ALL, $userdata);
foreach($forums_auth as $k=>$v)
{
if( $v['auth_view'] && $v['auth_read'] )
{
$forums_auth_sql .= (( $forums_auth_sql == '' ) ? '': ', ') . $k;
}
}
if ($forums_auth_sql != '')
{
$forums_auth_sql = ' AND t.forum_id IN (' . $forums_auth_sql . ') ';
}
// Delete the following line, to uncomment this block
*/
$sql = "SELECT t.*, u.user_id, u.username, f.forum_id, f.forum_name, p.post_time, p.post_username
FROM ". TOPICS_TABLE ." t, ". USERS_TABLE ." u, ". FORUMS_TABLE ." f, ". POSTS_TABLE ." p
WHERE t.topic_id <> $topic_id $forums_auth_sql
AND MATCH (t.topic_title) AGAINST ('" . addslashes($topic_title) . "')
AND f.forum_id = t.forum_id
AND p.post_id = t.topic_last_post_id
AND t.topic_poster = u.user_id
GROUP BY t.topic_id
ORDER BY t.topic_last_post_id DESC LIMIT 0,5";
#
#-----[ FIND ]------------------------------------------
#
$topics = array();
while ( $row = $db->sql_fetchrow($result) )
{
$topics[] = $row;
}
$count_similar = count($topics);
#
#-----[ REPLACE WITH ]------------------------------------------
#
$similar_topics = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
$count_similar = count($similar_topics);
#
#-----[ FIND ]------------------------------------------
#
for($i = 0; $i <count_similar>sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not get similar topics", '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
$similar = $row;
#
#-----[ REPLACE WITH ]------------------------------------------
#
for($i = 0; $i </a>assign_block_vars('similar.topics', array(
#
#-----[ AFTER, ADD ]------------------------------------------
#
'ROW_COLOR' => '#' . $row_color,
'ROW_CLASS' => $row_class,
#
#-----[ FIND ]------------------------------------------
#
} // while
} // for $i
} // if ( $count_similar > 0 )
#
#-----[ REPLACE WITH ]------------------------------------------
#
} //for $i
}// if ( $count_similar > 0 )
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewtopic_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<td><span><img></span></td>
<td>{similar.topics.NEWEST}<span>{similar.topics.TYPE}</span> <span>{similar.topics.TOPICS}</span></td>
<td><span>{similar.topics.AUTHOR}</span></td>
<td><span>{similar.topics.FORUM}</span></td>
<td><span>{similar.topics.REPLIES}</span></td>
<td><span>{similar.topics.POST_TIME} {similar.topics.POST_URL}</span></td>
#
#-----[ REPLACE WITH ]------------------------------------------
#
<td><img></td>
<td>{similar.topics.NEWEST}<span>{similar.topics.TYPE}</span> <span>{similar.topics.TOPICS}</span></td>
<td><span>{similar.topics.AUTHOR}</span></td>
<td><span>{similar.topics.FORUM}</span></td>
<td><span>{similar.topics.REPLIES}</span></td>
<td><span>{similar.topics.POST_TIME} {similar.topics.POST_URL}</span></td>