Author Topic: Few fixes and addons  (Read 7078 times)

blueeyeddevil

  • Active Member
  • ***
  • Posts: 43
  • Karma: +3/-0
Few fixes and addons
« on: January 13, 2015, 02:49:28 AM »
Here you can find few fixes and addons for Etano. All work good with Etrano 2.0. If you find any bugs or error logs please post it here. Thanks

http://www.testing-site.info/etano-addons.html

KHDev

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 498
  • Karma: +43/-2
  • Etano Contributor (Skins & Mods)
    • KH Web Development
Re: Few fixes and addons
« Reply #1 on: January 13, 2015, 06:06:08 PM »
I noticed in your "who viewed me" mod it doesn't include a cron job or function to purge old data.

I know it might not be mandatory but people should consider purging data older than a set time frame.

Also, consider that when a user deletes their account perhaps delete the stored WVM data which relates to that user to help keep things upto date.

:)

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 1004
  • Karma: +56/-7
Re: Few fixes and addons
« Reply #2 on: January 14, 2015, 09:45:29 PM »
I received an error when I tried to install "who viewed me". It says:

Event    Message
diff: /home/server/public_html/domain.com/tmp/packages/who_viewed_me-1.00/who_viewed_me.diff    

Cannot apply patch because the source file (/home/server/public_html/domain.com/skins_site/def/frame.html) is changed. Line 55 in diff file.

It won't install.
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 2883
  • Karma: +210/-7
    • Maverick Webworks
Re: Few fixes and addons
« Reply #3 on: January 14, 2015, 10:07:12 PM »
Quote
Cannot apply patch because the source file (/home/server/public_html/domain.com/skins_site/def/frame.html) is changed. Line 55 in diff file.

That's one of pit falls with creating auto install addons that tries editing or adding code to common files that are often customized by the user or if they happen to be using 3rd party template where the menu in the frame.html file may be different than the default.

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 2883
  • Karma: +210/-7
    • Maverick Webworks
Re: Few fixes and addons
« Reply #4 on: January 14, 2015, 10:17:06 PM »
Quote
I noticed in your "who viewed me" mod it doesn't include a cron job or function to purge old data.

I know it might not be mandatory but people should consider purging data older than a set time frame.

I totally agree, the "who viewed me" table in the database should be purged on a regular basis, such as on a weekly basis. If you have busy site with a large number of members this table will eventually grow astronomically in size over time. To keep the table at a managable size it should be purged on a regular basis. Users really only need to view the most recent members that have viewed their profile, like within the past week for example.

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 1004
  • Karma: +56/-7
Re: Few fixes and addons
« Reply #5 on: January 14, 2015, 10:22:53 PM »
Could this be an error in the who_viewed_me.diff file?

At line 50 it reads:

Code: [Select]
<a href="{tplvars.relative_url}my_photos.php">My Photos</a>
</li>

Is it supposed to be written as:
Code: [Select]
<li>
<a href="{tplvars.relative_url}my_photos.php">My Photos</a>
</li>

it just looks like an <li> is missing. Am I wrong?
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 2883
  • Karma: +210/-7
    • Maverick Webworks
Re: Few fixes and addons
« Reply #6 on: January 14, 2015, 10:41:14 PM »
That's just a reference as to where the DIFF file is to add the new link, which is likely below that. There's also code in the DIFF file @@ -71,3 +71,7 @@ which are coordinates where the change is to be made, however if your menu is different than the default or you've added menu items, etc., the  coordinates won't match and the install will fail.

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

blueeyeddevil

  • Active Member
  • ***
  • Posts: 43
  • Karma: +3/-0
Re: Few fixes and addons
« Reply #7 on: January 14, 2015, 11:06:00 PM »
Will make those cron jobs and other recommendations a bit later because right now busy creating bootstrap based template. If diff update fails it is most likely because of different html code in used template. So just open diff file inside package and update template file manually. The code you will add may also differ depending on your html template  so proposed code does not necesarily need to match rest of your template

abo

  • Prime Member
  • ****
  • Posts: 138
  • Karma: +0/-0
Re: Few fixes and addons
« Reply #8 on: March 14, 2015, 01:48:55 AM »
any news with this addon ... I mean with a cron job working on it ?
Thank's

SwingersGezocht

  • Active Member
  • ***
  • Posts: 30
  • Karma: +0/-0
Re: Few fixes and addons
« Reply #9 on: April 27, 2015, 01:25:59 AM »
Install doesent work:
diff: /home/swingers/domains/swingersgezocht.nl/public_html/tmp/packages/who_viewed_me-1.00/who_viewed_me.diff 
Cannot apply patch because the source file (/home/swingers/domains/swingersgezocht.nl/public_html/skins_site/def/frame.html) is changed. Line 55 in diff file.

I try it manual now...
Somebody tips off the cronjob?
I will display profile visitors for the last 30 days

SwingersGezocht

  • Active Member
  • ***
  • Posts: 30
  • Karma: +0/-0
Re: Few fixes and addons
« Reply #10 on: April 27, 2015, 02:21:26 AM »
Install files manual and import SQL into database is OK,
php file into the root, html file into the skin->def
SQL import:
Code: [Select]
CREATE TABLE IF NOT EXISTS `dsb_who_viewed_me` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `uid` int(11) NOT NULL,
  `vid` int(11) NOT NULL,
  `count` int(11) NOT NULL,
  `date` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

Only thing is, visitors doesent show into the page
(empty list / database)

tips?

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 2883
  • Karma: +210/-7
    • Maverick Webworks
Re: Few fixes and addons
« Reply #11 on: April 27, 2015, 06:14:28 AM »
You also have to manually add some code from the DIFF file (who_viewed_me.diff) into the following files:
profile.php
search.php
skins_site/def/frame.html

In the profile.php file you would look for this line:
Code: [Select]
$output=array();Then add the code below that as per the DIFF file.


In the search.php file you would look for this line:
Code: [Select]
case 'views':Then add the code below that as per the DIFF file.


In the skins_site/def/frame.html file you would add the following to the list of  "My Account" menu items.
Code: [Select]
<li >
<a href="{tplvars.relative_url}profile_views.php">Profile Views</a>
</li>
This would be for the V2 default template, if you're using a 3rd party template the menu(s) may be different and you will need to determine the best place to put the link.

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

SwingersGezocht

  • Active Member
  • ***
  • Posts: 30
  • Karma: +0/-0
Re: Few fixes and addons
« Reply #12 on: April 27, 2015, 06:47:13 AM »
I add in the profile.php the code:
Code: [Select]
if (!empty($_SESSION[_LICENSE_KEY_]['user']['user_id']) && $uid>0) {
$check="SELECT * FROM `{$dbtable_prefix}who_viewed_me` WHERE `uid`='".$_SESSION[_LICENSE_KEY_]['user']['user_id']."' AND `vid`='".$uid."' LIMIT 1";
if (!($res=@mysql_query($check))) {trigger_error(mysql_error(),E_USER_ERROR);}
if (mysql_num_rows($res)){
$query="UPDATE `{$dbtable_prefix}who_viewed_me` SET `count`=`count`+1,`date`=now() WHERE `uid`='".$_SESSION[_LICENSE_KEY_]['user']['user_id']."' AND `vid`='".$uid."'";
}else{
$query="INSERT INTO `{$dbtable_prefix}who_viewed_me` (`uid`,`vid`,`count`,`date`) VALUES ('".$_SESSION[_LICENSE_KEY_]['user']['user_id']."','".$uid."',1,now())";
}
if (!($res=@mysql_query($query))) {trigger_error(mysql_error(),E_USER_ERROR);}
After the
Code: [Select]
$output=array();
// we don't care about user status because the cache generator will generate the profile for the user only if status is approved
// also _photo is set only with approved photos.

But the profile views are still not updating.
Profile.html display`s 2 times the same profile :-(

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 2883
  • Karma: +210/-7
    • Maverick Webworks
Re: Few fixes and addons
« Reply #13 on: April 27, 2015, 07:28:45 AM »
Quote
Profile.html display`s 2 times the same profile
profile.html has nothing to do with displaying who's viewed your profile. It's displayed on the profile_views.php page.

I really don't know how this mod functions as I've never actually tried it out because it's not a feature I'm interest in, if the same member views a profile multiple times maybe it also displays the same member multiple times, technically it shouldn't function this way but who knows how the author created it.

Also make sure that you added the code for the search.php file.

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

blueeyeddevil

  • Active Member
  • ***
  • Posts: 43
  • Karma: +3/-0
Re: Few fixes and addons
« Reply #14 on: April 27, 2015, 03:53:41 PM »
Code looks if user previously seen the profile. If same user viewed profile before only count of views and date of last view are updated. If not then new record is inserted in table. Have already updated version if this mod just need to put together all changes. It even shows which views are new since user checked who viewed me page.