Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: 1 ... 6 7 8 9 [10] 11 12 13 14 ... 19   Go Down

Author Topic: Coppermine Forum Plugin (cpgforum)  (Read 513194 times)

0 Members and 2 Guests are viewing this topic.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Coppermine Forum Plugin (cpgforum)
« Reply #180 on: August 03, 2008, 08:26:50 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:

Code: [Select]
  $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();
Logged

streetart

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 48
Re: Coppermine Forum Plugin (cpgforum)
« Reply #181 on: August 04, 2008, 02:37:17 am »

ok thx.. :D
Logged

streetart

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 48
Re: Coppermine Forum Plugin (cpgforum)
« Reply #182 on: August 04, 2008, 01:41:10 pm »

@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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Coppermine Forum Plugin (cpgforum)
« Reply #183 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:
Code: [Select]
  $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]
« Last Edit: August 04, 2008, 02:20:20 pm by eenemeenemuu »
Logged

MadMaxx

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
Re: Coppermine Forum Plugin (cpgforum)
« Reply #184 on: August 05, 2008, 11:31:18 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
Logged

gavu

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
    • SibiuWall
Re: Coppermine Forum Plugin (cpgforum)
« Reply #185 on: August 06, 2008, 01:27:54 pm »

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?

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

streetart

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 48
Re: Coppermine Forum Plugin (cpgforum)
« Reply #186 on: August 07, 2008, 11:57:26 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:
Code: [Select]
  $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

Logged

mahdi1234

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 60
disable guest to see forum?
« Reply #187 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
Logged

streetart

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 48
Re: Coppermine Forum Plugin (cpgforum)
« Reply #188 on: August 08, 2008, 01:05:14 am »

you can hide the link for guest.

Code: [Select]
<?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;
        
}
?>
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Coppermine Forum Plugin (cpgforum)
« Reply #189 on: August 08, 2008, 07:42:32 am »

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:
Code: [Select]
  $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:
Code: [Select]
  $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
Code: [Select]
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
Code: [Select]
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>";
« Last Edit: December 05, 2008, 03:14:36 pm by eenemeenemuu »
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: disable guest to see forum?
« Reply #190 on: August 08, 2008, 07:48:18 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):
Code: [Select]
require_once("adaptor/include/functions.inc.php");
after, add:
Code: [Select]
// disable forum for guests
if (!USER_ID)
  cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);
Logged

streetart

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 48
Re: Coppermine Forum Plugin (cpgforum)
« Reply #191 on: August 09, 2008, 01:04:52 am »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Coppermine Forum Plugin (cpgforum)
« Reply #192 on: August 09, 2008, 11:24:01 am »

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.
Logged

streetart

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 48
Re: Coppermine Forum Plugin (cpgforum)
« Reply #193 on: August 12, 2008, 07:38:07 pm »

foulu is there possible what eenemeenemuu mean?
Logged

.JRauck

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Coppermine Forum Plugin (cpgforum)
« Reply #194 on: August 13, 2008, 10:03:22 am »

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...
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Coppermine Forum Plugin (cpgforum)
« Reply #195 on: August 13, 2008, 10:07:41 am »

rtfm >:(
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.
Logged

.JRauck

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Coppermine Forum Plugin (cpgforum)
« Reply #196 on: August 14, 2008, 01:25:27 am »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Coppermine Forum Plugin (cpgforum)
« Reply #197 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.
Logged

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: Coppermine Forum Plugin (cpgforum)
« Reply #198 on: August 14, 2008, 08:28:09 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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Coppermine Forum Plugin (cpgforum)
« Reply #199 on: August 14, 2008, 08:46:11 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.
Logged
Pages: 1 ... 6 7 8 9 [10] 11 12 13 14 ... 19   Go Up
 

Page created in 0.032 seconds with 20 queries.