#1 2013-08-16 10:57:57

adaliszk
Ionize Friend
From: Germany
Registered: 2010-09-20
Posts: 397
Website

Forum module

Still development!

I making a Forum module for Ionize 1.x.x, It's still development, but you can follow on github:https://github.com/adamos42/io_forum

The module is divided into tow parts, one is the forum display, the other is one Ajax API to modify forums, topics and posts. The display it's easy, I develop "one viewfile" solution with ionize tags.

Current working version is: 1.0.2
After module install open your database and run the trigger creators:

DROP TRIGGER IF EXISTS `forum_posts_after_insert`;
DELIMITER $$
CREATE TRIGGER `forum_posts_after_insert` AFTER INSERT ON `forum_posts`
FOR EACH ROW BEGIN

  DECLARE $user_id, $topic_id, $forum_id, $num_posts, $num_topics INT;
  DECLARE $last_date DATETIME;

  SELECT id_topic, id_user, `date` FROM forum_posts ORDER BY id_post DESC
    LIMIT 0,1 INTO $topic_id, $user_id, $last_date;

  SELECT id_forum FROM forum_topics WHERE id_topic = $topic_id
    INTO $forum_id;

  SELECT COUNT(*) FROM forum_posts WHERE id_topic = $topic_id
    INTO $num_posts;

  UPDATE forum_topics
    SET
      last_user = $user_id,
      last_date = $last_date,
      num_posts = $num_posts

  WHERE id_topic = $topic_id;

  SELECT COUNT(*) FROM forum_topics WHERE id_forum = $forum_id
    INTO $num_topics;

  UPDATE forums
    SET
      last_user = $user_id,
      last_date = $last_date,
      last_topic = $topic_id,
      num_topics = $num_topics

  WHERE id_forum = $forum_id;

END$$
DELIMITER;

DROP TRIGGER IF EXISTS `forum_topics_after_insert`;
DELIMITER $$
CREATE TRIGGER `forum_topics_after_insert` AFTER INSERT ON `forum_topics`
FOR EACH ROW BEGIN

  DECLARE $topic_id, $forum_id, $num_topic INT;
                
  SELECT id_forum FROM forum_topics ORDER BY id_topic DESC
    LIMIT 0,1 INTO $forum_id;
		            
  SELECT COUNT(*) FROM forum_topics WHERE id_forum = $forum_id INTO $num_topic;		         

  UPDATE forums SET num_topics = $num_topic WHERE id_forum = $forum_id;

 END$$
DELIMITER; 

Last edited by adaliszk (2015-02-03 08:25:05)


Webdeveloper, Programmer, Application developer, Ionize friend
@adaliszk

Offline

#2 2013-08-18 19:04:36

adaliszk
Ionize Friend
From: Germany
Registered: 2010-09-20
Posts: 397
Website

Re: Forum module

Now i uploadded the first working code!

https://github.com/adamos42/io_forum

Check the wiki for complete example!

https://github.com/adamos42/io_forum/wiki

Working example: http://cwlclan.hu/forum

Last edited by adaliszk (2015-02-03 08:18:19)


Webdeveloper, Programmer, Application developer, Ionize friend
@adaliszk

Offline

#3 2013-09-18 11:50:23

Jbey
Member
Registered: 2013-09-18
Posts: 1

Re: Forum module

Hello adamos.

I'm reallty interested but youre working example link seems broken. sad

May you have an other one ? big_smile

Thx

Offline

#4 2013-09-18 12:00:31

adaliszk
Ionize Friend
From: Germany
Registered: 2010-09-20
Posts: 397
Website

Re: Forum module

Jbey wrote:

Hello adamos.

I'm reallty interested but youre working example link seems broken. sad

May you have an other one ? big_smile

Thx

Hi Jbey,

We're moving to one other server, thats why that link broken, soon will be available again (1-2 days) I no have other site yet where needed the forum.


Webdeveloper, Programmer, Application developer, Ionize friend
@adaliszk

Offline

#5 2014-06-23 17:18:54

Alex L
Member
From: Germany-Rostock
Registered: 2014-06-23
Posts: 5
Website

Re: Forum module

Hello community,

I have a problem with the module forum. I use the last version Ionize and have downloaded the Forum module from github and installed it, but when I go under modules in the jaws of the Forum module displays me this error

Class Ajax_forum not found in:
/ www/htdocs/w0103f82/ionize/modules/Ajax_forum/controllers/admin /

What do I have so that the module is running?

About your feedback I am pleased. Thank you in advance!


I am 32 years old, bloggers, webmasters, shop owners and Forum provider. In my spare time I like most Open Source CMS and Forums.

Offline

#6 2014-06-23 18:20:53

adaliszk
Ionize Friend
From: Germany
Registered: 2010-09-20
Posts: 397
Website

Re: Forum module

Hi Alex L,

I'm still developing this module, the admin is not done yet, you can use the basic admin functions from the frontend side. I wanted to develop the missing functions in the next few days, beccause now i must use it.

Adamos42


Webdeveloper, Programmer, Application developer, Ionize friend
@adaliszk

Offline

#7 2014-06-23 19:38:58

Alex L
Member
From: Germany-Rostock
Registered: 2014-06-23
Posts: 5
Website

Re: Forum module

Hi Adamos42,
ok, thanks for your very quick reply. I would like to try this module and think it's great if you're going to develop it further. I look here in the forum in the next few days over.


I am 32 years old, bloggers, webmasters, shop owners and Forum provider. In my spare time I like most Open Source CMS and Forums.

Offline

#8 2014-06-27 08:50:24

lipki
Member
Registered: 2014-06-27
Posts: 7

Re: Forum module

I am also interested in this module and I can help if needed.

Offline

#9 2014-06-27 16:20:41

Alex L
Member
From: Germany-Rostock
Registered: 2014-06-23
Posts: 5
Website

Re: Forum module

I think that the module developers because what will make. I had the module the problem described above and there was an error message in Backned of Ionize.


I am 32 years old, bloggers, webmasters, shop owners and Forum provider. In my spare time I like most Open Source CMS and Forums.

Offline

#10 2014-06-28 01:33:23

lipki
Member
Registered: 2014-06-27
Posts: 7

Re: Forum module

Alex L wrote:

I think that the module developers because what will make. I had the module the problem described above and there was an error message in Backned of Ionize.


@Alex L : in modules
rename :
"io_forum/" -> "Forum/"

@Alex L : in modules/Forum/controllers/admin
change :
class forum extends Module_Admin {
to
class Forum extends Module_Admin {

Offline

#11 2014-06-28 02:48:02

Alex L
Member
From: Germany-Rostock
Registered: 2014-06-23
Posts: 5
Website

Re: Forum module

Hello,

it does not work for me. It is required Ajax_forum for the path / modules / and I have renamed it under modules. But it still does not work.

I also tried the solution which you wrote me here. And yet it does not work.

Were you at the forum you get up and running?


I am 32 years old, bloggers, webmasters, shop owners and Forum provider. In my spare time I like most Open Source CMS and Forums.

Offline

#12 2015-02-01 17:47:04

adaliszk
Ionize Friend
From: Germany
Registered: 2010-09-20
Posts: 397
Website

Re: Forum module

Hello there, sorry for the disapearing. I was busy with my work, so the main problem is that the forum module does not have backend yet and some things more. Keep in touch, I'm looking the code now (i have to use it again big_smile)


Webdeveloper, Programmer, Application developer, Ionize friend
@adaliszk

Offline

#13 2015-02-01 20:39:41

Tichu
Member
Registered: 2015-02-01
Posts: 21

Re: Forum module

adamos42 wrote:

Hello there, sorry for the disapearing. I was busy with my work, so the main problem is that the forum module does not have backend yet and some things more. Keep in touch, I'm looking the code now (i have to use it again big_smile)

thanks for supporting this forum module,

i too could not make it to even work for the frontend.
using latest ionizecms v 1.0.7.

any chance you can spare a working copy for 1.0.7?
or a fix of current git repo?

will gladly appreciate it.
thanks

Offline

#14 2015-02-01 20:48:14

adaliszk
Ionize Friend
From: Germany
Registered: 2010-09-20
Posts: 397
Website

Re: Forum module

I fixed some of the issues what is founded, for now i wanted to make a smarter module, so most of the code will be rewriten. Please create the issues on github what you have now: https://github.com/adamos42/io_forum/issues


Webdeveloper, Programmer, Application developer, Ionize friend
@adaliszk

Offline

#15 2015-02-02 00:01:17

Tichu
Member
Registered: 2015-02-01
Posts: 21

Re: Forum module

thanks for the fast reply,

well, i followed the twicks and hacks mentioned above then installed ok,  so i went ahead and created a new page in ionize called it forum and created a new view and added all the code example you have in the wikki,

so now when i go to mysite.com/forum/
i can see the forum page ok, i can even create a new forum title  loggedin as admin i doublechecked in the forums table in database and it created it ok,
but i can not see the new forum created nor the existinng topics or posts in the mysite.com/forum/  url,  it says i need to login or register,
but i am already logged in and got full permissions as superadmin,
i even cleared all cache and cookies and relogged as admin and still your forum sample code says i need to login or register.
here is the breadcrumb navigation showing i am not logged in.
Navigation:Fórum kezdőoldal

any advice on how to get over this issue?

Last edited by Tichu (2015-02-02 00:03:46)

Offline

#16 2015-02-02 09:50:59

adaliszk
Ionize Friend
From: Germany
Registered: 2010-09-20
Posts: 397
Website

Re: Forum module

First thing what I found was the installation database.xml has 2 triggers what has syntax error and therefore the topics and the posts table does not created. The syntax error was the delimiter the // need to be changed to $$. The second thing what I found is the base url,  if you installed the ionize in subfolder then the ajax request won't work, fix it by search the "ajax_forum" and replace with "<ion:base_url />ajax_forum" in your view. I will upload the fixed code today (~13-14h) on github. If you fix that 2 thing I think that will work or you can wait for the git push.


Webdeveloper, Programmer, Application developer, Ionize friend
@adaliszk

Offline

#17 2015-02-02 18:21:29

Tichu
Member
Registered: 2015-02-01
Posts: 21

Re: Forum module

thank you,
i tried the new repo and now i can create new forums and the newly created forums will display on page and edit them,
while logged in as superadmin

but it still wont let me create a topic nor show a topic,
i still get:
Navigation:Fórum kezdőoldal
it still asking me to login or register to be able to post topics or see them. even tho i am loggedin as superadmin, it wont recognize me as logged in user

maybe something to do with user code or authentication

Offline

#18 2015-02-02 18:29:09

adaliszk
Ionize Friend
From: Germany
Registered: 2010-09-20
Posts: 397
Website

Re: Forum module

Can you attach a screenshot?

ONE thing: Create a forum which will be your forum, then create a child forum wich is your topic container forum, you can not create a topic in the root forum.

Last edited by adaliszk (2015-02-02 18:43:34)


Webdeveloper, Programmer, Application developer, Ionize friend
@adaliszk

Offline

#19 2015-02-02 19:13:27

adaliszk
Ionize Friend
From: Germany
Registered: 2010-09-20
Posts: 397
Website

Re: Forum module

I found an other problem, now the tables are created but the tiggers not, you must execute this script to get work the topics:

DROP TRIGGER IF EXISTS `forum_posts_after_insert`;
               DELIMITER $$
               CREATE TRIGGER `forum_posts_after_insert` AFTER INSERT ON `forum_posts`
                FOR EACH ROW BEGIN

	               DECLARE $user_id, $topic_id, $forum_id, $num_posts, $num_topics INT;
	               DECLARE $last_date DATETIME;

	               SELECT id_topic, id_user, `date` FROM forum_posts ORDER BY id_post DESC
		               LIMIT 0,1 INTO $topic_id, $user_id, $last_date;

	               SELECT id_forum FROM forum_topics WHERE id_topic = $topic_id
		               INTO $forum_id;

	               SELECT COUNT(*) FROM forum_posts WHERE id_topic = $topic_id
		               INTO $num_posts;

	               UPDATE forum_topics
		               SET
			               last_user = $user_id,
			               last_date = $last_date,
			               num_posts = $num_posts

		               WHERE id_topic = $topic_id;

	               SELECT COUNT(*) FROM forum_topics WHERE id_forum = $forum_id
		               INTO $num_topics;

	               UPDATE forums
		               SET
			               last_user = $user_id,
			               last_date = $last_date,
			               last_topic = $topic_id,
			               num_topics = $num_topics

		               WHERE id_forum = $forum_id;


               END
               $$
               DELIMITER ;
DROP TRIGGER IF EXISTS `forum_topics_after_insert`;
            DELIMITER $$
            CREATE TRIGGER `forum_topics_after_insert` AFTER INSERT ON `forum_topics`
             FOR EACH ROW BEGIN

	            DECLARE $topic_id, $forum_id, $num_topic INT;
                
                SELECT id_forum FROM forum_topics ORDER BY id_topic DESC
		            LIMIT 0,1 INTO $forum_id;
		            
		         SELECT COUNT(*) FROM forum_topics WHERE id_forum = $forum_id INTO $num_topic;		         

	            UPDATE forums SET num_topics = $num_topic
		            WHERE id_forum = $forum_id;
               

            END
            $$
            DELIMITER ; 

After that the topics are showing, i can posting, all problem now is the image src is not pointing the right place, but that is in the view file. I updated the module on github with some adjustments.

Last edited by adaliszk (2015-02-02 19:18:22)


Webdeveloper, Programmer, Application developer, Ionize friend
@adaliszk

Offline

#20 2015-02-02 21:00:24

Tichu
Member
Registered: 2015-02-01
Posts: 21

Re: Forum module

thanks,
it is looking better,
altho some bugs:

i can now create a new forum, then create a child forum to allow topics,

but when i create new topic on child forum it will create ok on database,
but wont display in forum page,
throws error:
A PHP Error was encountered
Severity: Notice

Message: Trying to get property of non-object

Filename: libraries/forum_tags.php

Line Number: 310

Offline

#21 2015-02-02 21:16:28

adaliszk
Ionize Friend
From: Germany
Registered: 2010-09-20
Posts: 397
Website

Re: Forum module

it because the triggers are not fired, for now the triggers save the topic/post counts and last poster id and some infos more. If the id_user is 0 then they can't select the user/topic/post therefore it show an error.

Last edited by adaliszk (2015-02-02 22:45:13)


Webdeveloper, Programmer, Application developer, Ionize friend
@adaliszk

Offline

#22 2015-02-02 22:46:41

adaliszk
Ionize Friend
From: Germany
Registered: 2010-09-20
Posts: 397
Website

Re: Forum module

I'm developing the new version of this module, for now it is working with the triggers, I think i will be done on this weekend.


Webdeveloper, Programmer, Application developer, Ionize friend
@adaliszk

Offline

#23 2015-02-03 00:44:19

Tichu
Member
Registered: 2015-02-01
Posts: 21

Re: Forum module

adamos42 wrote:

it because the triggers are not fired, for now the triggers save the topic/post counts and last poster id and some infos more. If the id_user is 0 then they can't select the user/topic/post therefore it show an error.

Iam not familiar with the db triggers,

do they get firedup when installing the module only?



looking forward to see the new forum rewrite in action.

thanks again.

Offline

#24 2015-02-03 08:10:30

adaliszk
Ionize Friend
From: Germany
Registered: 2010-09-20
Posts: 397
Website

Re: Forum module

Tichu wrote:

do they get firedup when installing the module only?.

They fired after insert topics and after insert posts but the module installer does not create them (maybe because they have some characters in it what the installer can't handle), if you open the database with phpmyadmin or something similar then you can run the trigger crator sql; for now that have to do to use the module version v1.0.x. The new version using views instead triggers, that sould be creating with module installer, but I will test it when the new version is ready to release. The new version source code can be found on github: https://github.com/adamos42/io_forum/tree/development


Webdeveloper, Programmer, Application developer, Ionize friend
@adaliszk

Offline

#25 2015-02-03 18:47:59

Tichu
Member
Registered: 2015-02-01
Posts: 21

Re: Forum module

so the new version  in development still not function right?

ok the other version with triggers still not working,

Itry to add them manually from phpmyadmin but returms error some syntax,

any chance you can provide me your forum tables  sql dump which includes the triggers so i can just import into mine?


thanks in advanced

Offline

What's Ionize ?

Ionize is an Open Source Content Management System created by webdesigners for webdesigners.

Created and maintained by Partikule and Toopixel, Ionize wants to be the easiest and most powerful CMS.

Can I help ?

Because talent is nothing without involvement, we are looking for motivated coders and webdesigners to join the project team.

Resources

Website : ionizecms.com
Documentation : doc.ionizecms.com

Development : Ionize on GitHub
Translations : Ionize Translations