1
xsell
Comment ID
  • 2010/2/16 6:25

  • xsell

  • Quite a regular

  • Posts: 245

  • Since: 2008/9/2 1


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

2
ghia
Re: Comment ID
  • 2010/2/16 9:39

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


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

3
xsell
Re: Comment ID
  • 2010/2/16 17:48

  • xsell

  • Quite a regular

  • Posts: 245

  • Since: 2008/9/2 1


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



4
ghia
Re: Comment ID
  • 2010/2/16 18:08

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


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

5
xsell
Re: Comment ID
  • 2010/2/16 21:15

  • xsell

  • Quite a regular

  • Posts: 245

  • Since: 2008/9/2 1


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

6
xsell
Re: Comment ID
  • 2010/2/16 21:23

  • xsell

  • Quite a regular

  • Posts: 245

  • Since: 2008/9/2 1


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

Login

Who's Online

146 user(s) are online (95 user(s) are browsing Support Forums)


Members: 0


Guests: 146


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits