Welcome,
Guest
.
Please
login
or
register
.
Did you miss your
activation email
?
News:
Elxis 5.5 Calypso supports 2 factor authentication login with e-mail or SMS.
Home
Help
Login
Register
Elxis CMS Forum
»
Extensions
»
Components
»
Star Gallery counter
« previous
next »
Print
Pages: [
1
]
Author
Topic: Star Gallery counter (Read 4984 times)
ioarvanit
Newbie
Posts: 9
Star Gallery counter
«
on:
October 06, 2007, 21:03:06 »
in star gallery the picture counter works OK after the ajax window is open, but the first click on the foto (before the ajax window open is not considered by the counter). So if a visitor of our site clicks on a picture and then closes the ajax window the counter of the foto is not increased as should be.
So i opened the stargallery.php file and experimented on the code until i came up with this solution of the problem. In line 233 (after the user rights are checked and a bit before the ajax window is loaded) i added the following code:
//Update counter (this part is not in the original stargallery component)
$query = "SELECT * FROM #__stargallery WHERE id='$id' AND catid=".$catid.""
. "\n AND approved=1 AND published=1";
$database->setQuery( $query, '#__', 1, 0 );
$rows = $database->loadObjectList();
$row = &$rows[0];
$newimgcounter = $row->imgcounter + 1;
$database->setQuery( "UPDATE #__stargallery SET imgcounter='$newimgcounter' WHERE id='$row->id'" );
$database->query();
Now the counter of the picture takes all clicks in consideration and seems to be working ok.
http://www.klain.gr/index.php?option=com_content&task=view&id=55&Itemid=74
Logged
Farhad Sakhaei
Elxis Community
Hero Member
Posts: 1190
I know nothing , Should know more & more
Re: Star Gallery counter
«
Reply #1 on:
October 06, 2007, 21:16:34 »
the star gallery has few another problems that they will be fixed in next release by Ioannis
Logged
DediData Web Hosting Services
Print
Pages: [
1
]
« previous
next »
Elxis CMS Forum
»
Extensions
»
Components
»
Star Gallery counter