Flexi as downloads component?

More
8 years 15 hours ago #61537 by lipatovroman
Ok, thanks.
I will make new site with Flexi :)

Please Log in or Create an account to join the conversation.

More
7 years 11 months ago #61575 by ggppdk
Hello

currently since v2.1.x
FLEXIcontent also stores some download history / statistics too, but they are not yet display

(the DB table is keep small because it log single entry counter for unlogged users per file)

these will be viewable in the future


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
7 years 11 months ago - 7 years 11 months ago #61706 by lipatovroman
Please help me with this:

I have file field and text field with name Hits.
I need each time user press on download button text field Hits value increases on 1



I think it should be sql query in file filed plugin.
But I 'm not programmer, so I can't understand how to make it.
Thanks.

P.S. I tried to edit file /plugins/flexicontent_fields/file/tmpl/value_InlineBoxes.php

After this code
Code:
// The download button in a mini form ... $actions_arr[] = '' .'<form id="form-download-'.$field->id.'-'.($n+1).'" method="post" action="'.$dl_link.'" style="display:inline-block;" >' .$file_data_fields .'<input type="submit" name="download-'.$field->id.'[]" class="'.$file_classes.' btn-success fcfile_downloadFile" title="'.$downloadsinfo.'" value="'.$downloadstext.'"/>' .'</form>'."\n";

I added own code:
Code:
if(isset($_POST['download-'.$field->id.'[]'])) { $db = JFactory::getDbo(); $query = $db->getQuery(true); $sql= mysql_query ('UPDATE biblsoft_flexicontent_fields_item_relations SET value = value + 1 WHERE field_id = 22 and item_id = '.$item->id); }

But it does not work :(
Last edit: 7 years 11 months ago by lipatovroman.

Please Log in or Create an account to join the conversation.

More
7 years 11 months ago #61709 by micker
at first do no edit this field duplicate and rename value_YOURTEMPLATENAME.php and select it in field admin
you became safe for update

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
7 years 11 months ago #61712 by lipatovroman
Ok, I understand.
But can you help me with my problem?

Please Log in or Create an account to join the conversation.

More
7 years 11 months ago - 7 years 11 months ago #61720 by ggppdk
Hello

inside your template file
item.php (or item_html5.php)

you can use:
Code:
echo '<label class="label">'. JText::_('FLEXI_HITS').'</label>'; $file_data_arr = $item->fields['myfile_fieldname']->file_data; if ( empty($file_data_arr) ) echo 'no file exists'; else { $file_data = reset($file_data_arr); // get data of first file; echo $file_data->hits; }


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
Last edit: 7 years 11 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.304 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline