Coppermine Forum Plugin (cpgforum) - Page 10 Coppermine Forum Plugin (cpgforum) - Page 10
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Coppermine Forum Plugin (cpgforum)

Started by foulu, April 01, 2008, 07:46:11 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Αndré

Quote from: foulu on July 31, 2008, 06:53:52 PM
I'm finished with this plugin. I don't release new 1.x.x version anymore even it have some addon in my localhost.
Pity :(

If i find some time, i'll try to include some simple features and post it here.



streetart asked me via PM, how to show the latest posts on an extra page because he has seen it on my personal gallery.
Here is the code:

  $forum_limit = 5;
  if (is_numeric($_POST['limit_forum']))
    $forum_limit = $_POST['limit_forum'];
  if ($forum_limit > 50)
    $forum_limit = 50;
  if ($forum_limit < 5)
    $forum_limit = 5;

  $text_forum = "<input type=\"text\" class=\"textinput\" name=\"limit_forum\" size=\"3\" value=\"$forum_limit\" style=\"padding-top:0px;padding-bottom:0px;\" />";
  starttable("100%", "<form method=\"post\" action=\"#forum\" style=\"margin-bottom:0;margin-top:0\">Die letzten $text_forum Beitr&auml;ge im Forum</form>");

  $forum = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_PREFIX']}fr_messages m INNER JOIN {$CONFIG['TABLE_PREFIX']}fr_topics t ON m.topic_id = t.topic_id ORDER BY msg_id DESC LIMIT $forum_limit");

  while ($post = mysql_fetch_array($forum, MYSQL_ASSOC))
  {
    $topic_total_page = ceil($post['replies']/$CONFIG['fr_msg_per_page']);
    $topic = $post['topic_id'];
    $topic .= "&amp;start=".($topic_total_page-1)*$CONFIG['fr_msg_per_page'];
    $topic .= "#".$post['msg_id'];

    echo "<tr><td class=\"tableb\">".date("d.m.Y H:i",$post['poster_time'])." - neuer Beitrag von ".$post['poster_name']." im Thema '<a href=\"forum.php?topic=$topic\" target=\"_self\">".str_replace("Re: ","",$post['subject'])."</a>'</td></tr>";
  }
  endtable();

streetart


streetart

@eenemeenemuu nice code..I tested it now and it is very nice. one question. is there possible, to display every topic only once..when two person reply on the same topic and display the same topic twice..?


on german: kann man die Themen zusammenfassen? Wenn ich auf ein Thema antworte und dann zwei Minuten spätr nochmals jemand antwortet wird das gleiche Thema zwei angezeigt. Ist es möglich das zu verhindern und nur den neuesten Eintrag von dem Thema wirklich anzuzeigen?


sry for my english

Αndré

#183
This is already implemented in the cpgforum "Info Center" (i think this has gone to core, if not: see here).

The new sql statement for my code contribution is:
  $forum = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_PREFIX']}fr_messages m INNER JOIN {$CONFIG['TABLE_PREFIX']}fr_topics t ON m.topic_id = t.topic_id WHERE msg_id IN (SELECT MAX(msg_id) FROM {$CONFIG['TABLE_PREFIX']}fr_messages GROUP BY topic_id) ORDER BY msg_id DESC LIMIT $forum_limit");


[edit by muu: code correction]

MadMaxx

Quote from: eenemeenemuu on August 03, 2008, 08:26:50 PM

If i find some time, i'll try to include some simple features and post it here.


well don't know about simple  ;)  but attachments would be really nice  ;D

gavu

i recently changed hosting and noticed that when creating a new topic i get:

There was an error while processing a database query.

debug mode says:

While executing query "INSERT INTO `cpg14x_fr_topics`
   (topic_id, is_sticky, board_id, first_msg_id, last_msg_id, started_member_id, updated_member_id, poll_id, replies, views, locked)   
   VALUES
   ('', '1', '1', '', '', '18', '', '', '0', '0', '0');" on 0

mySQL error: Incorrect integer value: '' for column 'topic_id' at row 1

what did i do wrong?

it's not a bug, it's a feature

streetart

Quote from: eenemeenemuu on August 04, 2008, 02:06:11 PM
This is already implemented in the cpgforum "Info Center" (i think this has gone to core, if not: see here).

The new sql statement for my code contribution is:
  $forum = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_PREFIX']}fr_messages m INNER JOIN {$CONFIG['TABLE_PREFIX']}fr_topics t ON m.topic_id = t.topic_id WHERE msg_id IN (SELECT MAX(msg_id) FROM {$CONFIG['TABLE_PREFIX']}fr_messages GROUP BY topic_id) ORDER BY msg_id DESC LIMIT $forum_limit");


[edit by muu: code correction]

yes but when I reply on a topic than the topic must skip on the top like in this smf board in the recent post section? like the boardview..I hope you can me help


mahdi1234

Cool plugin.

I have one question - is it possible to make forum completely invisible for guests? When set "Allow guests to browse the forum" to "No" they can navigate thru structure, but I would like guest not to be able do so.

thx,
mahdi

streetart

you can hide the link for guest.

<?php if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');


if (!
USER_ID) {
       
$user_group USER_GROUP;
echo<<<EOT


content

EOT;

      } else if (
USER_GROUP=='Registered') {
      
$user_name USER_NAME;
$user_group USER_GROUP;
echo<<<EOT

content


EOT;


} else if (USER_GROUP=='Administrators') {
   
$user_name USER_NAME;
$user_group USER_GROUP;
echo<<<EOT

content

EOT;
        
}
?>

Αndré

#189
Quote from: streetart on August 07, 2008, 11:57:26 PM
yes but when I reply on a topic than the topic must skip on the top like in this smf board in the recent post section? like the boardview..I hope you can me help

Have you tried my instructions? I think you haven't.
Your question was, how to show the latest posts on an extra page.

Here again:

Use this code, to show the latest posts, even if they are in the same topic:
  $forum_limit = 5;
  if (is_numeric($_POST['limit_forum']))
    $forum_limit = $_POST['limit_forum'];
  if ($forum_limit > 50)
    $forum_limit = 50;
  if ($forum_limit < 5)
    $forum_limit = 5;

  $text_forum = "<input type=\"text\" class=\"textinput\" name=\"limit_forum\" size=\"3\" value=\"$forum_limit\" style=\"padding-top:0px;padding-bottom:0px;\" />";
  starttable("100%", "<form method=\"post\" action=\"#forum\" style=\"margin-bottom:0;margin-top:0\">Die letzten $text_forum Beitr&auml;ge im Forum</form>");

  $forum = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_PREFIX']}fr_messages m INNER JOIN {$CONFIG['TABLE_PREFIX']}fr_topics t ON m.topic_id = t.topic_id ORDER BY msg_id DESC LIMIT $forum_limit");

  while ($post = mysql_fetch_array($forum, MYSQL_ASSOC))
  {
    $topic_total_page = ceil($post['replies']/$CONFIG['fr_msg_per_page']);
    $topic = $post['topic_id'];
    $topic .= "&amp;start=".($topic_total_page-1)*$CONFIG['fr_msg_per_page'];
    $topic .= "#".$post['msg_id'];

    echo "<tr><td class=\"tableb\">".date("d.m.Y H:i",$post['poster_time'])." - neuer Beitrag von ".$post['poster_name']." im Thema '<a href=\"forum.php?topic=$topic\" target=\"_self\">".str_replace("Re: ","",$post['subject'])."</a>'</td></tr>";
  }
  endtable();



Use this code, to show the topics with the latest posts:
  $forum_limit = 5;
  if (is_numeric($_POST['limit_forum']))
    $forum_limit = $_POST['limit_forum'];
  if ($forum_limit > 50)
    $forum_limit = 50;
  if ($forum_limit < 5)
    $forum_limit = 5;

  $text_forum = "<input type=\"text\" class=\"textinput\" name=\"limit_forum\" size=\"3\" value=\"$forum_limit\" style=\"padding-top:0px;padding-bottom:0px;\" />";
  starttable("100%", "<form method=\"post\" action=\"#forum\" style=\"margin-bottom:0;margin-top:0\">Die letzten $text_forum Beitr&auml;ge im Forum</form>");

  $forum = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_PREFIX']}fr_messages m INNER JOIN {$CONFIG['TABLE_PREFIX']}fr_topics t ON m.topic_id = t.topic_id WHERE msg_id IN (SELECT MAX(msg_id) FROM {$CONFIG['TABLE_PREFIX']}fr_messages GROUP BY topic_id) ORDER BY msg_id DESC LIMIT $forum_limit");

  while ($post = mysql_fetch_array($forum, MYSQL_ASSOC))
  {
    $topic_total_page = ceil($post['replies']/$CONFIG['fr_msg_per_page']);
    $topic = $post['topic_id'];
    $topic .= "&amp;start=".($topic_total_page-1)*$CONFIG['fr_msg_per_page'];
    $topic .= "#".$post['msg_id'];

    echo "<tr><td class=\"tableb\">".date("d.m.Y H:i",$post['poster_time'])." - neuer Beitrag von ".$post['poster_name']." im Thema '<a href=\"forum.php?topic=$topic\" target=\"_self\">".str_replace("Re: ","",$post['subject'])."</a>'</td></tr>";
  }
  endtable();





[update 2008-12-05]
The code above is for version 1.x of cpgforum. If you want to use it for version 2.x, just replace
echo "<tr><td class=\"tableb\">".date("d.m.Y H:i",$post['poster_time'])." - neuer Beitrag von ".$post['poster_name']." im Thema '<a href=\"forum.php?topic=$topic\" target=\"_self\">".str_replace("Re: ","",$post['subject'])."</a>'</td></tr>";
with
echo "<tr><td class=\"tableb\">".date("d.m.Y H:i",$post['poster_time'])." - neuer Beitrag von ".$post['poster_name']." im Thema '<a href=\"forum.php?c=message&id={$post['msg_id']}\" target=\"_self\">".str_replace("Re: ","",$post['subject'])."</a>'</td></tr>";

Αndré

Quote from: mahdi1234 on August 08, 2008, 12:17:50 AM
Cool plugin.

I have one question - is it possible to make forum completely invisible for guests? When set "Allow guests to browse the forum" to "No" they can navigate thru structure, but I would like guest not to be able do so.

thx,
mahdi

Open forum.php, find (should be line 11):
require_once("adaptor/include/functions.inc.php");

after, add:
// disable forum for guests
if (!USER_ID)
  cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);


streetart

Hey thx and sry, my mistake.. Another question. Is there also possible to display the newest post since last visit? that was nice...

Αndré

No it's not possible, because it's not recorded in the database yet.
When foulu give me his local copy, i want to implement this feature and release it.

streetart

foulu is there possible what eenemeenemuu mean?

.JRauck

I don't understand how to install this... I read the read me on how to install plugins but it didn't help much. I first changed the plugin permission to 777. I then logged in on coppermine as an admin. I went to config. > general settings > enabled plugins > clicked on (Manage Plugins) > Browse > Uploaded the zipped file, when I clicked on upload it looked like it just reloaded the page but when I went under my plugin folder on my server there were files there. I reloaded the plugin manager page but it didnt add the plugin under the sample plugins.

I would be appreciated if someone would help me...

Αndré

rtfm >:(
Quote from: foulu on April 01, 2008, 07:46:11 AM
To install just extract & copy all the file to your coppermine folder then go to plugin manager to install it. Forum address will be: {CPG_DIR}/forum.php.

You can't "install" it by only visiting the plugin manager.

.JRauck

After I send the folder to my coppermine folder where do I go to install it on the plugins manager?

Αndré

Which folder? Extract the package and upload the whole structure to your cpg directory! After doing this, you can go to pluginmgr.php and install it.

Hein Traag

Quote from: eenemeenemuu on August 14, 2008, 06:27:35 AM
Which folder? Extract the package and upload the whole structure to your cpg directory! After doing this, you can go to pluginmgr.php and install it.

[hold-hand-mode]
cpg-root-dir - plugins - forumfolder
[/hold-hand-mode]

Extraxt the zip and upload the extracted dir into the plugins folder. Fire up cpg admin plugin manager and click on the i to install the plugin.

Αndré

Quote from: Hein Traag on August 14, 2008, 08:28:09 AM
Extraxt the zip and upload the extracted dir into the plugins folder. Fire up cpg admin plugin manager and click on the i to install the plugin.
This isn't correct. You have to extract the zip and upload the whole structure to cpg root dir.