8 replies [Last post]
jace1319
jace1319's picture
Offline
Regular
Last seen: 6 years 50 weeks ago
Timezone: GMT-4
Joined: 2011-01-10
Posts: 41
Points: 61

Hi everyone this is my web link

http://www.psdflyers.net/index.php/buy-now/36-bparty

- I would like to place the "Love button" right next to the word "hits"

here's the instructions for the "Love button"
http://codecanyon.net/item/the-love-button/full_screen_preview/2835724

-so far I've uploaded the folder to my root directory I've created the database and uploaded the SQL file and i also edit the settings.inc.php to contain the proper database names.

-NOW my issue is with the coding. First I'm not sure where exactly i have to place the css code (which stylesheet and where). I also need to know where do i place this javascript? my last questions is if im using the css code do i also need the javascript code for it to function or can i only use the css instead of the javascript. Sorry for the noob question just abit confused.

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 3 weeks 5 days ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5344
Points: 2965

Hi jace1319, The CSS you

Hi jace1319,
The CSS you should link to in the head of your page.
The instructions suggest you place the JavaScript at the bottom of the page just before the closing </body>
Not sure of your template system so can't really help with that.

Yes you will need the JavaScript as well as the CSS for it to function.

mihirc
mihirc's picture
Offline
Leader
Pune, Maharashtra, India
Last seen: 8 years 43 weeks ago
Pune, Maharashtra, India
Timezone: GMT+5.5
Joined: 2007-05-09
Posts: 728
Points: 204

Hello, If you are using

Hello,

If you are using default Joomla article management system you will find the "hits" line in components/com_content/views/articles/tmpl/default.php - line no ~84.

You can edit this file and place the code there, to get it included in all the article pages. As far as the css goes, you can put that in here as well. As tony suggests the js should go in before the body, but then it will be loaded in each page. If you want to load it, just for the articles, then you should place it here as well.

Regards,
Mihir.

Proprietor - Thoughtfulviewfinder Services
Web Development | Design | Merchandise | Photography
My personal blog: MihirChhatre.com

jace1319
jace1319's picture
Offline
Regular
Last seen: 6 years 50 weeks ago
Timezone: GMT-4
Joined: 2011-01-10
Posts: 41
Points: 61

yes i would like for the

yes i would like for the button to show up on every article I tried following your steps but its not working

This is the code ive included in my article html section

<a href="#" title="Love it" class="lovebtn" data-count="loading">&#9829; Love it</a>

This is the css code - just not sure how to include this in line 84

<link href='http://psdflyers.net/lovebutton/luv.css' rel='stylesheet' type='text/css'>

this is what line 84 looks like

<?php $useDefList = (($params->get('show_author')) or ($params->get('show_category')) or ($params->get('show_parent_category'))
	or ($params->get('show_create_date')) or ($params->get('show_modify_date')) or ($params->get('show_publish_date'))
	or ($params->get('show_hits'))); ?>

And this javascript code ive included in my article section as well since I've enabled javascript

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
$(function () {
 
    var love_script_folder = 'http://psdflyers.net/lovebutton/count.php';
 
    $.ajax({
        type: "GET",
        url: love_script_folder,
        success: function (data) {
            if (!data.match('exist')) {
                if (data.length != <img src="https://csscreator.com/sites/all/modules/smileys/packs/Roving/innocent.png" title="Innocent" alt="Innocent" class="smiley-content" /> {
 
                    if (data.match(':')) {
                        $('.lovebtn').attr('data-count', data.split(':')[1]);
                    } else {
                        $('.lovebtn').attr('data-count', data);
                    }
                } else {
                    $('.lovebtn').attr('data-count', '0');
                }
            } else {
                alert('Database not setup correctly: Debug Info:' + data);
            }
        }
    });
 
});
 
$(".lovebtn").click(function () {
 
    var love_script_folder = 'http://example.com/lovebutton/count.php';
 
    $.ajax({
        type: "POST",
        url: love_script_folder,
        data: {
            save: "1"
        },
        success: function (data) {
            if (data.match('already')) {
                alert('you already loved this!');
            } else {
                $('.lovebtn').attr('data-count', data);
                alert('thanks for your love!');
            }
        }
    });
 
});
</script>

any other help is greatly appreciated

mihirc
mihirc's picture
Offline
Leader
Pune, Maharashtra, India
Last seen: 8 years 43 weeks ago
Pune, Maharashtra, India
Timezone: GMT+5.5
Joined: 2007-05-09
Posts: 728
Points: 204

Hello,Could you share a link

Hello,

Could you share a link to the live page, so that i can take a look at it?
//edit - i can see the link you have shared - could you please post the file where you have inserted the code? i dont think the "<a>" is actually getting loaded. Probably you put it in the code, which gets hidden through your params? If you can paste the source of the file, i can take a look - or even better - i will just try it out myself.

Regards,
Mihir.

Proprietor - Thoughtfulviewfinder Services
Web Development | Design | Merchandise | Photography
My personal blog: MihirChhatre.com

jace1319
jace1319's picture
Offline
Regular
Last seen: 6 years 50 weeks ago
Timezone: GMT-4
Joined: 2011-01-10
Posts: 41
Points: 61

ok you can download the files

ok you can download the files here
http://www.mediafire.com/?15cp97fur2wedjy

and attached is where my file is located

AttachmentSize
lovbutto.png 38.26 KB
mihirc
mihirc's picture
Offline
Leader
Pune, Maharashtra, India
Last seen: 8 years 43 weeks ago
Pune, Maharashtra, India
Timezone: GMT+5.5
Joined: 2007-05-09
Posts: 728
Points: 204

Hello, I was away for the

Hello,

I was away for the weekend. taking the look at the files today.

Regards,
Mihir.

Proprietor - Thoughtfulviewfinder Services
Web Development | Design | Merchandise | Photography
My personal blog: MihirChhatre.com

jace1319
jace1319's picture
Offline
Regular
Last seen: 6 years 50 weeks ago
Timezone: GMT-4
Joined: 2011-01-10
Posts: 41
Points: 61

no problem. thank you for

no problem. thank you for your efforts

cositirozasx
cositirozasx's picture
Offline
newbie
New York
Last seen: 10 years 27 weeks ago
New York
Timezone: GMT+5
Joined: 2012-11-22
Posts: 1
Points: 1

A effortless switch producer

A effortless switch producer can be a great promotional means for your cathedral in numerous ways. This amusing and simple to use badge manufacturer will permit you to encourage special actions, prize youthful people, and more http://www.mazapoint.com/category/tupac-love-quotes