Passing Image ID

munkeeworks
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 31 Aug 2008, 00:02

Passing Image ID

Post by munkeeworks »

Hey Everybody,
This is my first time posting to this forum, I'm not sure if I am in the right section...
Could someone help me. What I am trying to do is pass the Image ID and/or the CATID of the image that is being previewed

I have the link in this file.
site_root/components/com_phocagallery/views/detail/tmpl/default.php
the url would look something like this
http://www.mysite.com/custompage.php?catid= &imgid=

Thanks Ron
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48416
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Passing Image ID

Post by Jan »

Hi, the catid and image id is loaded from model (from database)

e.g. category.php in model folder,

this is called from view (e.g. views/category/view.html.php)..
view file sends the outcome to the default.php

id and catid are saved in the object:
$this->items (in default.php)

if you run e.g. foreach to get all data:
foreach($this->items as $key => $value)
you can get the id and catid:
$value->catid ($this->items[x]->catid)
$value->id ($this->items[x]->id) ... where small x is a number of displayed image
If you find Phoca extensions useful, please support the project
munkeeworks
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 31 Aug 2008, 00:02

Re: Passing Image ID

Post by munkeeworks »

Thanks for the reply,
I still need a little help.

in the slideshow mode I want to have a link that will pass the image ID and CatID

I all ready have the link started in this location
views/detail/tmpl/default.php



<tr>
<td align="left" width="200" style="padding-left:48px"><?php echo $this->file->prevbutton ;?></td>
<?php

require('/site_root/components/com_phocagallery/views/category/view.html.php');
$value1 =$this->file->id;
$value2 =$this->file->catid;
echo '<td><a href="http://www.mysite.com/custompage.php?ca ... nk</a></td>';


?>
<td><?php echo $this->file->slideshowbutton ;?></td>
<td><?php echo str_replace("%onclickreload%", $this->detailwindowreload, $this->file->reloadbutton);?></td>
<td><?php echo str_replace("%onclickclose%", $this->detailwindowclose, $this->file->closebutton);?></td>
<td align="right" width="200" style="padding-right:48px"><?php echo $this->file->nextbutton ;?></td>
</tr>
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48416
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Passing Image ID

Post by Jan »

please let me know, what doesn't work ?
If you find Phoca extensions useful, please support the project
munkeeworks
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 31 Aug 2008, 00:02

Re: Passing Image ID

Post by munkeeworks »

if I echo this
$value1 =$this->file->id;
$value2 =$this->file->catid;
echo "ID: " . $value1. " CatID: " .$value2;

it returns
ID: CatID:
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48416
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Passing Image ID

Post by Jan »

maybe you call $this->file object in place where it does't exist or is empty ... maybe there should be some $value object (if it displayed in foreach ... )
If you find Phoca extensions useful, please support the project
Post Reply