xoops forums

goffy

Quite a regular
Posted on: 11/13 21:01
goffy
goffy (Show more)
Quite a regular
Posts: 382
Since: 2010/12/27
#1

Xoops Comment system

Hi to all

I have a problem in my wggallery:
If I use xoops comment system then I can add for each image a comment. I have to click on "show image" to get ot single image, then I click on "Add comment". Modal with form for submitting comment appears. After clicking on submit xoops redirect to the image index site (list with all image of current album), but it should go back to single image.

how can I control where it will be redirected after submitting comment?

Lupin

Just popping in
Posted on: 11/27 9:58
Lupin
Lupin (Show more)
Just popping in
Posts: 59
Since: 2007/6/1 2
#2

Re: Xoops Comment system

Confirmed , I have the same prob ... very strange : problem appears ONLY at firs cooment added ... then the redirect bring correctly at the image page ...

Pino

goffy

Quite a regular
Posted on: 11/27 21:01
goffy
goffy (Show more)
Quite a regular
Posts: 382
Since: 2010/12/27
#3

Re: Xoops Comment system

hi

by debugging the xoops core code step by step I found the solution:
it is necessary to adapt xoops_version.php
$modversion['hasComments']             = 1;
$modversion['comments']['pageName']    = 'images.php';
$modversion['comments']['itemName']    = 'img_id';
$modversion['comments']['extraParams'] = ['op''alb_id''start''limit''img_submitter'];


the interesting line is
$modversion['comments']['extraParams'] = ['op''alb_id''start''limit''img_submitter'];


here you have to repeat all parameters, which should be used for redirect after posting the comment.

Important: this parameters must be in the $_POST of the site, where the comments are called from.
example:
I call my site by:
http://localhost/wggallery/htdocs/mod ... &limit=10&img_submitter=0

I post a comment. now comment system takes 'op', 'alb_id', 'start', 'limit', 'img_submitter' from the $_POST and create the redirect url based on these parameters
after succesful posting of the comment you will be redirected to site from "$modversion['comments']['pageName'] = 'images.php';" by using the param from "$modversion['comments']['extraParams']"