I've tried to use visitor IP as owner guid of a annotation.
I need to do this, because i want to make unique visitor counter and i need the visitor IP
maybe like this,
create_annotation ( $entity_guid,
$name,
$value,
$value_type = '',
$owner_guid = VISITOR IP for example : 127001,
$access_id = ACCESS_PRIVATE
)
I've been succesful to do this and display no error,
but i want to ask , will it be dangerous ? , like my database became exploded , or fatal error in the future ?
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- ihayredinov@ihayredinov
ihayredinov - 0 likes
- iionly@iionly
iionly - 0 likes
- Avicena AlGhiffar Alsharaawy@AVicenaGhifa
Avicena AlGhiffar Alsharaawy - 0 likes
- Steve Clay@steve_clay
Steve Clay - 0 likes
- Avicena AlGhiffar Alsharaawy@AVicenaGhifa
Avicena AlGhiffar Alsharaawy - 0 likes
- Avicena AlGhiffar Alsharaawy@AVicenaGhifa
Avicena AlGhiffar Alsharaawy - 0 likes
- Avicena AlGhiffar Alsharaawy@AVicenaGhifa
Avicena AlGhiffar Alsharaawy - 0 likes
- ihayredinov@ihayredinov
ihayredinov - 0 likes
- Avicena AlGhiffar Alsharaawy@AVicenaGhifa
Avicena AlGhiffar Alsharaawy - 0 likes
- Avicena AlGhiffar Alsharaawy@AVicenaGhifa
Avicena AlGhiffar Alsharaawy - 0 likes
You must log in to post replies.Don't do it! Instead use something like this:
But all of this is quite inefficient. Why not use Piwik/Google Analytics for that?
As Piwik/Google Analytics was mentioned: https://elgg.org/plugins/384520.
Though I personnally could understand that someone doesn't want some companies to be able to follow every step my members do.
I will make unique visitor counter for every user,
maybe like ,user A has total 23 unique visitor, user B has ttotal 29 unique visitor, so I think use annotations is best way for my goal , coz I can count visitor for each user
$options = array(
'annotation_names' => array('unique visitor'),
'owner_guid' => THE USERGUID,
'count' => true
);
I'll second the suggest to not store non-GUIDs as GUID values. Asks for big trouble.
@steve what is the possible problem?
@ismayl , why do you use two create_annotations?
Okey this is my code , i hope someone can improve it , or simplify it
OK, i change my code now
became
And now my question: is it dangerous if i use $current_ip as value of annotation ?
Using IP as annotation value is fine. But I really don't follow this logic. If someone is on a shared IP, you will be counting views as unique every time user visits an entity page.
If you use annotations, you can already determine unique visits by annotation owner and timestamp. Instead of storing the IP which tells you little, store a serialized array of useful information, or just set the value to 1 if you want to keep it simple.
Here is how I log ad impressions and clicks https://github.com/hypeJunction/Elgg-ads/blob/master/classes/hypeJunction/Ads/Ad.php
Annotation->owner_guid just work if the visitor is logged in user ,right ? , what if someone visit my page from Google search?, so I think I have to save the visitor IP, but yes, I must solve the shared IP problem,
ooo , i want to ask again. is it safe to create annotations without owner_guid ?
In my code, if someone (not logged in user) visit my site, his/her IP will be stored as annotations value , but the annotations has no owner guid, (because not logged in user has no user guid) , is it dangerous ?