xoops forums

xsell

Quite a regular
Posted on: 2010/2/16 6:25
xsell
xsell (Show more)
Quite a regular
Posts: 245
Since: 2008/9/2 1
#1

Comment ID

Hello

I have Made a private Module , I have Problem with Comments post ..

When Comment Posted it redierect the Browser to Comment ID Not found. and i know why but cant figuer out how to solve it.

$modversion['hasComments'] = 1;
$modversion['comments']['itemName'] = 'pid';
$modversion['comments']['pageName'] = 'view.php';


as u can see the comment itemname is 'pid'

Now the Comments add Ok the Problem Only with the Redierect after the comment posted .. it dose not redirect me to none cooment .. the Reason is in the View page i Use 'cid' and 'pid' .. where cid is Category Id and pid is the item Id ..

so the redierect url looks like this
view.php?pid=4&com_id=8&com_rootid=8&com_mode=thread&com_order=0#comment8


when the redirect url should include the cid like this
view.php?cid=1&pid=4&com_id=8&com_rootid=8&com_mode=thread&com_order=0#comment8


So How to Fix it where the Redierect url includes cid ..

ghia

Community Support Member
Posted on: 2010/2/16 9:39
ghia
ghia (Show more)
Community Support Member
Posts: 4954
Since: 2008/7/3 1
#2

Re: Comment ID

Why do you need cid?
pid is an autoincrement field, no?
As such it is a unique indentifier for your item and is enough to retrieve the data.
The cid can be retrieved in the database (assuming that it somewhere in someway is associated with the pid record).

xsell

Quite a regular
Posted on: 2010/2/16 17:48
xsell
xsell (Show more)
Quite a regular
Posts: 245
Since: 2008/9/2 1
#3

Re: Comment ID

Ghia ,

cid is the Category ID
pid is the item ID

So u click on the Categorey Name u go with

/modules/test/category.php?cid=1

then when click item

/modules/test/category.php?cid=1&pid=5


ghia

Community Support Member
Posted on: 2010/2/16 18:08
ghia
ghia (Show more)
Community Support Member
Posts: 4954
Since: 2008/7/3 1
#4

Re: Comment ID

Is the last one not view.php?
But, unless you have also a ?cid=2&pid=5, there is no technical reason to insist on the specification of cid and you can display the item with: view.php?pid=5

xsell

Quite a regular
Posted on: 2010/2/16 21:15
xsell
xsell (Show more)
Quite a regular
Posts: 245
Since: 2008/9/2 1
#5

Re: Comment ID

Hello Ghia,
view.php , category.php Just Examples Names ..

Now lets Say you have a Video Gallery ..

You Click the Category name U must Go x.php?cid=1

Now you are in the Category Page .. there 10 Video Files in this Category .. So u click to view One x.php?cid=1&pid=4

where 4 is the video id and 1 is the category id ..

I have no problem with any thing but the Comment Call back or Redierect .. browser dose not redierect u to the comment root .. So wht i think i need it to Make an Extra Param with array('cid') or Make a call back Function to redierect the browser to the root comment ..

Looking in the Modules that uses Category like lisitng modules , maybe i can find clue .. But if Someone knows the answer . Hit Me..

xsell

Quite a regular
Posted on: 2010/2/16 21:23
xsell
xsell (Show more)
Quite a regular
Posts: 245
Since: 2008/9/2 1
#6

Re: Comment ID

Ok i can not belive how easy it was i looked into x_movie

and the answer was

// Comments
$modversion['hasComments'] = 1;
$modversion['comments']['itemName'] = 'lid';
$modversion['comments']['pageName'] = 'video_view.php';
$modversion['comments']['extraParams'] = array('cid');


it worked .. now it redierect me to the root comment where it should