Page 1 of 1
photo contest
Posted: 26 Dec 2011, 17:35
by mhehm
hello
sorry for my bad english.
I want to have a photo contest by phocagallery.
this work will be done with rate to category images. The images that have more points are the winners. I just need to set a period time dor rating to category images. I've added a date field to category parameters that user can set date of end rating. i added this by edit joomla_root/administrator/components/com_phocagallery/models/forms/phocagalleryc.xml
and i add another date field under date field and add a column to database with phpmyadmin. it work.
in file: joomlaroot/components/com_phocagallery/views/detail/tmpl/default_rating.php
line: if ((int)$this->tmpl['displayratingimg'] == 1)
i need to say that if current date is after category `rate end date` (the field that i added to category). rating tools disable
how i do that???
how i get fields of category that current image is in that ?
please help
Re: photo contest
Posted: 26 Dec 2011, 21:45
by Jan
Hi, this needs to be customized, for now I don't have any experiences with such customization so no specific advices there
Jan
Re: photo contest
Posted: 26 Dec 2011, 23:07
by mhehm
i just want codes that i can get a field of current image`s category.
Re: photo contest
Posted: 25 Jan 2012, 20:19
by mhehm
in:
Code: Select all
joomla_root/administrator/components/com_phocagallery/models/forms/phocagalleryc.xml
after:
Code: Select all
<field name="date" type="Calendar" class="inputbox" label="COM_PHOCAGALLERY_FIELD_DATE_LABEL" description="COM_PHOCAGALLERY_FIELD_DATE_DESC" filter="safehtml" />
add:
Code: Select all
<field name="rateenddate" type="Calendar" class="inputbox" label="COM_PHOCAGALLERY_FIELD_RATEENDDATE_LABEL" description="COM_PHOCAGALLERY_FIELD_DATE_DESC" filter="safehtml" />
---------------
with phpmyadmin in table (
#__phocagallery_categories) add field (
rateenddate) with type (
datetime) after field
date
----------------
at end of below file :
Code: Select all
/administrator/language/en-GB/en-GB.com_phocagallery.ini
add:
Code: Select all
COM_PHOCAGALLERY_FIELD_RATEENDDATE_LABEL="Rating Ends"
-----------------
for show user that uploaded current photo in detail page and link it to jomsocial profile of user:
in:
Code: Select all
joomla_root/components/com_phocagallery/views/detail/tmpl/default.php
after:
add:
Code: Select all
$photouser = JFactory::getUser($this->item->userid);
$titleDesc .= ' - '.JText::_('COM_PHOCAGALLERY_UPLOADED_BY').' <a href="index.php?option=com_community&view=profile&userid='.$photouser->id.'" target="_parent" >'.$photouser->name.' ( '.$photouser->username.' ) </a>';
---------------
in:
Code: Select all
joomla_root/components/com_phocagallery/views/detail/tmpl/default_rating.php
change:
Code: Select all
if ($this->tmpl['alreadyratedimg']) {
to:
Code: Select all
$db =& JFactory::getDBO();
$query = "SELECT c.rateenddate FROM mhe_phocagallery_categories c WHERE c.id = ".$this->item->catid." AND (c.rateenddate >= NOW() OR c.rateenddate = '0000-00-00 00:00:00')";
$db->setQuery($query);
$db->query();
$num_rows = $db->getNumRows();
if($num_rows == 0) $voteMsg = JText::_('COM_PHOCAGALLERY_ENDING_RATE_IMG');
if ($this->tmpl['alreadyratedimg'] || ($num_rows == 0)) {
---------------
at end of below file :
Code: Select all
language/en-GB/en-GB.com_phocagallery.ini
add:
Code: Select all
COM_PHOCAGALLERY_ENDING_RATE_IMG="Rating time is over"
COM_PHOCAGALLERY_RATEENDDATE="Rating End"
-----------------
in:
Code: Select all
joomla_root/components/com_phocagallery/models/categories.php
after:
add:
Code: Select all
$tree[$iCT]->rateenddate = $key->rateenddate;
-----------------
in:
Code: Select all
joomla_root/components/com_phocagallery/views/categories/tmpl/default_catimgdetailfloat.php
after:
Code: Select all
.'<td>'.$this->categories[$i]->hits.' '.JText::_('COM_PHOCAGALLERY_CATEGORY_VIEWED') .'</td></tr>'."\n";
add:
Code: Select all
if($this->categories[$i]->rateenddate != '0000-00-00 00:00:00')
echo '<tr><td>'.JText::_('COM_PHOCAGALLERY_RATEENDDATE') .': </td>'
.'<td>'.JHTML::_('date', $this->categories[$i]->rateenddate, JText::_('DATE_FORMAT_LC2')).'</td></tr>'."\n";
-----------------
in:
Code: Select all
joomla_root/components/com_phocagallery/views/categories/tmpl/default_catimgdetail.php
after:
Code: Select all
.'<td>'.$this->categories[$i]->hits.' '.JText::_('COM_PHOCAGALLERY_CATEGORY_VIEWED') .'</td></tr>'."\n";
add:
Code: Select all
if($this->categories[$i]->rateenddate != '0000-00-00 00:00:00')
echo '<tr><td>'.JText::_('COM_PHOCAGALLERY_RATEENDDATE') .': </td>'
.'<td>'.JHTML::_('date', $this->categories[$i]->rateenddate, JText::_('DATE_FORMAT_LC2')).'</td></tr>'."\n";
Re: photo contest
Posted: 27 Jan 2012, 16:45
by mhehm
With the previous post changes, you can set up your photo contest.
for this do below steps:
1- create category
2- in category settings set "Upload Rights" to "all registered users"
3- in category settings set "Category Folder"
3- in category Publishing Options set "Rating Ends Date"
do not forget to in phocagallery option to active rating setting and User Control Panel to allow users to can upload images and rate photos
Re: photo contest
Posted: 30 Jan 2012, 00:57
by Jan
Hi, thank you for the guide.
Jan