• Welcome to Simple Machines Community Forum. Please login or sign up.
January 28, 2022, 05:45:38 PM

News:

SMF 2.0.19 has been released! Please update. Read more.


Visualizzazione index e accesso alle aree

Started by Elisa, July 02, 2004, 04:59:51 AM

Previous topic - Next topic

Elisa

Vorrei fare in modo che i visitatori possano vedere tutte le aree nell'index, ma poi per entrare debbano registrarsi, si può?

FaSan

Basta Agire all' interno delle Permission delle Board  ;D

Elisa

July 02, 2004, 06:57:11 AM #2 Last Edit: July 03, 2004, 06:42:38 AM by Elisa
Ci sono stata un'ora a guardare nei permessi, ma non ci sono saltata fuori! Che sciocca!
Grazie!

FaSan

E no, mi sà che ho toppato eheheh

Ho visto che Unknow ti ha postato un'apposita modifca nell' area international  ;)

Elisa

Si, scusa l'ho messo anche li perchè credevo di avere piu possibilità di risposta!

FaSan


faxt

Ciao a tutti!
Sto cercando questa modifica ma non la trovo nel mare di 3d che ci sono  :(
Sareste così gentili da indicarmela o passarmela?  :)

Grazie 1000 ;D

faxt

May 26, 2005, 03:34:39 PM #7 Last Edit: May 27, 2005, 09:07:03 AM by faxt
ho trovato la vecchia discussione dove si dice:

Find, Sources/BoardIndex.php:
Code:

   // Find all boards and categories, as well as related information.


Replace:
Code:

   // If the current user is a guest, show all the boards but don't allow access.
   if ($user_info['is_guest'])
      $user_info['query_see_board'] = '(' . $user_info['query_see_board'] . ' OR FIND_IN_SET(0, b.memberGroups))';

   // Find all boards and categories, as well as related information.



Io ho fatto però mi si crea un problema  :(
Dai permessi settati su "amministra le board" ho fatto in modo che i visitatori del mio forum non vedano alcune board.
Una volta modificato il sorgente le vedono tutte e oltretutto cliccando sul titolo della board riescono a vedere le discussioni  :(

Vi posto il pezzo di sorgente prima e dopo la modifica, così magari vi scappa qualche consiglio  o mi segnalate qualche errore :)

***Board Index.php (prima della modifica)

   // Find all boards and categories, as well as related information.
   $result_boards = db_query("
      SELECT
         c.name AS catName, c.ID_CAT, b.ID_BOARD, b.name AS boardName, b.description,
         b.numPosts, b.numTopics, b.ID_PARENT,
         IFNULL(mem.memberName, m.posterName) AS posterName, m.posterTime, m.subject, m.ID_TOPIC,
         IFNULL(mem.realName, m.posterName) AS realName," . (!$user_info['is_guest'] ? "
         (IFNULL(lb.logTime, 0) >= b.lastUpdated) AS isRead, c.canCollapse,
         IFNULL(cc.ID_MEMBER, 0) AS isCollapsed" : ' 1 AS isRead') . ",
         IFNULL(mem.ID_MEMBER, 0) AS ID_MEMBER, m.ID_MSG,
         IFNULL(mem2.ID_MEMBER, 0) AS ID_MODERATOR, mem2.realName AS modRealName
      FROM {$db_prefix}categories AS c, {$db_prefix}boards AS b
         LEFT JOIN {$db_prefix}messages AS m ON (m.ID_MSG = b.ID_LAST_MSG)
         LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)" . (!$user_info['is_guest'] ? "
         LEFT JOIN {$db_prefix}log_boards AS lb ON (lb.ID_BOARD = b.ID_BOARD AND lb.ID_MEMBER = $ID_MEMBER)
         LEFT JOIN {$db_prefix}collapsed_categories AS cc ON (cc.ID_CAT = c.ID_CAT AND cc.ID_MEMBER = $ID_MEMBER)" : '') . "
         LEFT JOIN {$db_prefix}moderators AS mods ON (mods.ID_BOARD = b.ID_BOARD)
         LEFT JOIN {$db_prefix}members AS mem2 ON (mem2.ID_MEMBER = mods.ID_MEMBER)
      WHERE $user_info[query_see_board]
         AND b.ID_CAT = c.ID_CAT
         AND b.childLevel <= 1
      ORDER BY c.catOrder, b.childLevel, b.boardOrder", __FILE__, __LINE__);

****Board Index.php (dopo la modifica)

   // If the current user is a guest, show all the boards but don't allow access.
   if ($user_info['is_guest'])
      $user_info['query_see_board'] = '(' . $user_info['query_see_board'] . ' OR FIND_IN_SET(0, b.memberGroups))';

   // Find all boards and categories, as well as related information.
   $result_boards = db_query("
      SELECT
         c.name AS catName, c.ID_CAT, b.ID_BOARD, b.name AS boardName, b.description,
         b.numPosts, b.numTopics, b.ID_PARENT,
         IFNULL(mem.memberName, m.posterName) AS posterName, m.posterTime, m.subject, m.ID_TOPIC,
         IFNULL(mem.realName, m.posterName) AS realName," . (!$user_info['is_guest'] ? "
         (IFNULL(lb.logTime, 0) >= b.lastUpdated) AS isRead, c.canCollapse,
         IFNULL(cc.ID_MEMBER, 0) AS isCollapsed" : ' 1 AS isRead') . ",
         IFNULL(mem.ID_MEMBER, 0) AS ID_MEMBER, m.ID_MSG,
         IFNULL(mem2.ID_MEMBER, 0) AS ID_MODERATOR, mem2.realName AS modRealName
      FROM {$db_prefix}categories AS c, {$db_prefix}boards AS b
         LEFT JOIN {$db_prefix}messages AS m ON (m.ID_MSG = b.ID_LAST_MSG)
         LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)" . (!$user_info['is_guest'] ? "
         LEFT JOIN {$db_prefix}log_boards AS lb ON (lb.ID_BOARD = b.ID_BOARD AND lb.ID_MEMBER = $ID_MEMBER)
         LEFT JOIN {$db_prefix}collapsed_categories AS cc ON (cc.ID_CAT = c.ID_CAT AND cc.ID_MEMBER = $ID_MEMBER)" : '') . "
         LEFT JOIN {$db_prefix}moderators AS mods ON (mods.ID_BOARD = b.ID_BOARD)
         LEFT JOIN {$db_prefix}members AS mem2 ON (mem2.ID_MEMBER = mods.ID_MEMBER)
      WHERE $user_info[query_see_board]
         AND b.ID_CAT = c.ID_CAT
         AND b.childLevel <= 1
      ORDER BY c.catOrder, b.childLevel, b.boardOrder", __FILE__, __LINE__);


Grazie a tutti ;)

Advertisement: