solved Play count

alt=
DannyA
@dannya
10 years ago
584 posts
How does jamroom control "Play count". Is there some mechanism to prevent people from increasing the playcount? How does that work?
updated by @dannya: 08/10/14 06:34:57AM
michael
@michael
10 years ago
7,746 posts
ipaddress and user id are recorded to prevent duplicate counts.
alt=
DannyA
@dannya
10 years ago
584 posts
Great. Thanks
sbhadauria
@sbhadauria
10 years ago
129 posts
How can we record ipaddress and user id. Kindly suggest?
paul
@paul
10 years ago
4,332 posts
Checkout the jr_jrcore_count_ip database table. All user IDs and IPs for all count actions are saved there.
hth
Pa


--
Paul Asher - JR Developer and System Import Specialist
sbhadauria
@sbhadauria
10 years ago
129 posts
Hi Paul,

Thanks for your response,How can we save module and item id in this table.
How can we know that which media (songs) is liked and counting f this item.

updated by @sbhadauria: 07/06/14 10:54:50PM
brian
@brian
10 years ago
10,148 posts
sbhadauria:
Hi Paul,

Thanks for your response,How can we save module and item id in this table.
How can we know that which media (songs) is liked and counting f this item.


Can you clarify our question? It's not clear what you're asking.

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
michael
@michael
10 years ago
7,746 posts
If your talking about saving items to the datastore, take a look in the:
/modules/jrCore/lib/datastore.php

file to see all of the functions available for dealing with datastores.

You will see functions like:
* jrCore_db_create_item()
* jrCore_db_update_item()
* jrCore_db_get_item()
* jrCore_db_search_items()

and each of them will have documentation about what the function is for. eg:
/**
 * Search a module DataStore and return matching items
 *
 * $_params is an array that contains all the function parameters - i.e.:
 *
 * <code>
 * $_params = array(
 *     'search' => array(
 *         'user_name = brian',
 *         'user_height > 72'
 *     ),
 *     'order_by' => array(
 *         'user_name' => 'asc',
 *         'user_height' => 'desc'
 *     ),
 *     'group_by' => '_user_id',
 *     'return_keys' => array(
 *         'user_email',
 *         'username'
 *      ),
 *     'return_count' => true|false,
 *     'limit' => 50
 * );
 *
 * wildcard searches use a % in the key name:
 * 'search' => array(
 *     'user_% = brian',
 *     '% like brian%'
 * );
 * </code>
 *
 * "no_cache" - by default search results are cached - this will disable caching if set to true
 *
 * "cache_seconds" - set length of time result set is cached
 *
 * "return_keys" - only return the matching keys
 *
 * "return_count" - If the "return_count" parameter is set to TRUE, then only the COUNT of matching
 * entries will be returned.
 *
 * "privacy_check" - by default only items that are viewable to the calling user will be returned -
 * set "privacy_check" to FALSE to disable privacy settings checking.
 *
 * "ignore_pending" - by default only items that are NOT pending are shown - set ignore_pending to
 * TRUE to skip the pending item check
 *
 * "exclude_(module)_keys" - some modules (such as jrUser and jrProfile) add extra keys into the returned
 * results - you can skip adding these extra keys in by disable the module(s) you do not want keys for.
 *
 * Valid Search conditions are:
 * <code>
 *  =        - "equals"
 *  !=       - "not equals"
 *  >        - greater than
 *  >=       - greater than or equal to
 *  <        - less than
 *  <=       - less than or equal to
 *  like     - wildcard text search - i.e. "user_name like %ob%" would find "robert" and "bob". % is wildcard character.
 *  not_like - wildcard text negated search - same format as "like"
 *  in       - "in list" of values - i.e. "user_name in brian,douglas,paul,michael" would find all 4 matches
 *  not_in   - negated "in least" search - same format as "in"
 * </code>
 * @param string $module Module the DataStore belongs to
 * @param array $_params Search Parameters
 * @return mixed Array on success, Bool on error
 */
function jrCore_db_search_items($module, $_params)

If your using an IDE for development, then you will see that documentation inside your IDE wherever that function is used.

Take a look at the existing modules for other examples of how they are used.
sbhadauria
@sbhadauria
10 years ago
129 posts
I want to store item id with module name and ipaddress or userid so we need to make new database table or can use existing.
michael
@michael
10 years ago
7,746 posts
Probably best to make a new table. Its real hard to know with such limited information about what your doing.
sbhadauria
@sbhadauria
10 years ago
129 posts
Thanks guys for your quick response.
alt=
DannyA
@dannya
10 years ago
584 posts
What table are the actual play count stored? i.e. linked to the object it is counting?
michael
@michael
10 years ago
7,746 posts
jr_jrcore_count_ip

count_name: audio_file_stream_count
alt=
DannyA
@dannya
10 years ago
584 posts
Got it. my bad.

Tags