1
coops
HTTP GET request (i think thats what it is...)
  • 2005/8/9 23:56

  • coops

  • Just popping in

  • Posts: 82

  • Since: 2005/6/15


In the How to add the comment system to your module docs it says to add the unique ID and page name.

eg for article.php?storyid=(unique id here)
Quote:

$modversion['comments']['itemName'] = 'storyid';
$modversion['comments']['pageName'] = 'article.php';


im working on popnupblog, so that would be index.php?param=(unique id here)
Quote:
$modversion['comments']['itemName'] = 'param';
$modversion['comments']['pageName'] = 'index.php';


the problem is that to view a whole blog, the url is:
Quote:
/modules/popnupblog/index.php?param=1


but to view an entry (and for comments etc) the url is:
Quote:
modules/popnupblog/index.php?param=1-20050809204231


but the template is the same for both. this structure makes it so that using the XOOPS core comment system is not possible, right? (because its the same template and unique id name, so you would have the comment system only for the whole blog, but shown on every page, or repeated per post in the whole blog view. basically the comments wouldnt be post specific.)

is there any hope?

2
Dave_L
Re: HTTP GET request (i think thats what it is...)
  • 2005/8/10 0:32

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Is this a new module you're writing?

Why not make the blog-as-a-whole one item, and individual blog entries different items. Then each could have its own ID, its own template, and its own comments.

3
coops
Re: HTTP GET request (i think thats what it is...)
  • 2005/8/10 6:09

  • coops

  • Just popping in

  • Posts: 82

  • Since: 2005/6/15


Quote:

Dave_L wrote:
Is this a new module you're writing?

nah im trying to edit popnupblog just for my own site. if people want that edited version i can share it, but would like to get permission from the makers. for now im just trying to add the comment system for myself! :)

Quote:
Why not make the blog-as-a-whole one item, and individual blog entries different items. Then each could have its own ID, its own template, and its own comments.
i'm sure for someone who knows php that would be done in 15 mins... but i have no idea where to start in editing it! i could make the template in no time, but to seperate the "params" function into two seperate ones... i don't know where to start!
then how would i change the rest of the module to work with the two functions?
if i posted that function here, would anyone be able to tell me how to start splitting it?

4
coops
Re: HTTP GET request (i think thats what it is...)
  • 2005/8/10 23:59

  • coops

  • Just popping in

  • Posts: 82

  • Since: 2005/6/15


what if i said please?

5
hyperpod
Re: HTTP GET request (i think thats what it is...)
  • 2005/8/11 0:09

  • hyperpod

  • Quite a regular

  • Posts: 359

  • Since: 2004/10/4


Are the IDs only numeric with a - in it... do they always look like the example you posted?

If so you might be able to use a variation of the XOOPS comments hack I made last night.

xoops comments hack


For security you should only allow numbers and dashes on any GET or POST of the com_itemid.

Best Regards,
Daniel Hall / XOOPS Module Development & Theme Design
Free XOOPS Support > My Wish List

6
WarDick
Re: HTTP GET request (i think thats what it is...)
  • 2005/8/11 0:23

  • WarDick

  • Just can't stay away

  • Posts: 890

  • Since: 2003/9/13


Check out this module comment anywhere.
Urging XOOPS to be the Best It Can Be.
Richard......

7
coops
Re: HTTP GET request (i think thats what it is...)
  • 2005/8/11 7:46

  • coops

  • Just popping in

  • Posts: 82

  • Since: 2005/6/15


Quote:
Are the IDs only numeric with a - in it... do they always look like the example you posted?


Yeah they are always the example as above, ill just re-paste it here: Quote:
For Posts:
modules/popnupblog/index.php?param=1-20050809204231

it goes like this: param=(blogid)-(year)(month)(day)(hour)(min)(sec)(something else i cant figure out)

or if u wanna see the code: Quote:
$param = PopnupBlogUtils::makeParams($today['blogid'], $today['year'],$today['month'],$today['date'],$today['hours'], $today['minutes'], $today['seconds'], $cmd );


Look at the request samples for each:
Whole blog: modules/popnupblog/index.php?param=1
Each Post: modules/popnupblog/index.php?param=1-20050809204231

so the trick is to get a comment system that works ONLY when it's viewing each post, not the while blog.

also I need to figure out how to seperate the templates,
at the moment it uses the same template for both the whole blog and each post!

8
coops
Re: HTTP GET request (i think thats what it is...)
  • 2005/8/11 7:50

  • coops

  • Just popping in

  • Posts: 82

  • Since: 2005/6/15


Quote:
For security you should only allow numbers and dashes on any GET or POST of the com_itemid.
hehe I dont know if it's worth explaining, but can you at least tell me if this is ok?

both of you, thanks for the mods, i'll give them a try now and let u know how it goes...

9
hyperpod
Re: HTTP GET request (i think thats what it is...)
  • 2005/8/11 8:04

  • hyperpod

  • Quite a regular

  • Posts: 359

  • Since: 2004/10/4


Well, thats certainly possible. you would simply need to hack the XOOPS comments syem to allow numbers and - only and then only allow comments when param contains a -

hacking the core XOOPS is not highly recommended, since it makes upgrades alot stickier.


If you can use a module like WarDick suggested, then thats a preferred solution over hacking the core.


The hack I mentioned, you would still need to add - support.



Best Regards,
Daniel Hall / XOOPS Module Development & Theme Design
Free XOOPS Support > My Wish List

10
coops
Re: HTTP GET request (i think thats what it is...)
  • 2005/8/11 8:13

  • coops

  • Just popping in

  • Posts: 82

  • Since: 2005/6/15


hehe i already sacrificed a clear upgrade path when i converted my site over to xoops, i converted the invision forum to one from bbpixel, so if i want to upgrade i still have to rely on them for the next one...

Quote:
you would simply need to hack the XOOPS comments syem to allow numbers and - only and then only allow comments when param contains a -
...i want comments for the downloads and articles etc, so i guess i would have to add some condition so that it allows comments on any module and request, but if param requests come, to only allow comments if it has numbers after the -

am i making sense?

would u have any idea how i could start? (php is dutch to me!)

still installing that other mod...

Login

Who's Online

215 user(s) are online (128 user(s) are browsing Support Forums)


Members: 0


Guests: 215


more...

Donat-O-Meter

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

Latest GitHub Commits