Anyone good with PHP? Need help

spectrejoe

Elite Member
Jr. VIP
Joined
Sep 25, 2013
Messages
4,455
Reaction score
2,555
Could use some help with something, Need to add a "onclick" feature from content lockers from CPAGRIP to a wordpress plugin written in php where people gotta click like to see the content and i want to make it so that the content locker will also popup when they press like.

I can pay a bit I guess
 
You want javascript for this, not php.

well idk if you can add a java script to a php file since I only know basic programming (still learning) .

But if someone could do it, it would be amazing
 
Just open the PHP file in any text editor and add the onclick javascript where the html shows up right now. There's no PHP in that area of the code just HTML
 
Just open the PHP file in any text editor and add the onclick javascript where the html shows up right now. There's no PHP in that area of the code just HTML
couldn't find that area though, that's the problem
 
You can insert HTML/Javascript right after the PHP-end tag.
there's loads of files though idk in which one to insert it into...

and to make the like locker show up I just need to use a tag called [to_like] so there's no php in the actual post
 
I have an old script laying around on a computer at my other home. I'll see if I can access it and find it tomorrow when I go to work and if so, I'll PM it to you.

It's easy enough even a moron like me can set it up.
 
I have an old script laying around on a computer at my other home. I'll see if I can access it and find it tomorrow when I go to work and if so, I'll PM it to you.

It's easy enough even a moron like me can set it up.

Thanks so much for all the help this past week :D
 
there's loads of files though idk in which one to insert it into...

and to make the like locker show up I just need to use a tag called [to_like] so there's no php in the actual post

Bro i will check that php shortcode file to see if i can find the line there, maybe i missed a spot there. Will pm you here or on skype after i recheck it.
 
Here is the script. Put it anywhere on your site after you customize it... I had it set for 3 different offers but you can change that.

<script type="text/javascript">

var Delay = 100;//Seconds after them clicking the link, the gateway vanishes.

function setupgateway()
{
var Left = $(window).width() /2;
Left = Left - $('#gatewaydiv').width()/2;

var Top = $(window).height() /2;
Top = Top - $('#gatewaydiv').height()/2;

$('#gatewaydiv').css('top', Top+'px').css('left', Left+'px').css('display', 'inline');
$('#gatewayDimmer').width($('html').width());
$('#gatewayDimmer').height($('html').height());
$('#gatewayDimmer').css('display','block');
}

function removegateway()
{
$('#gatewaydiv').css('display', 'none');
$('#gatewayDimmer').css('display','none');
}

$(document).ready(function()
{
$('.offerlink').click(function()
{
setTimeout('removegateway()', Delay*1000);
});

setupgateway();
});
</script><div id="gatewayDimmer">
</div>
<style>

body
{
background-image:
background-repeat:repeat;
height:100%;
margin:0;
}

#mainContent
{
background-color:black;
margin-left:auto;
margin-right:auto;
margin-top:30px;
width:700px;
border:3px solid #A52A2A ;
text-align:center;
}

#gatewaydiv
{
background-image:url();
background-repeat:no-repeat;
width:500px;
height:300px;
padding:20px;
position:absolute;
display:none;
background-color:#000000;
border:solid 4px gray;
text-align:center;
font-family:arial;
}

#gatewaydiv h1
{
font-size:35px;
color:red;
}

#gatewayMessage
{
font-size:18px;
}

.offerlink
{
color:red;
font-weight:bold;
}

#OfferList
{
margin:0;
padding:0;
}

#OfferList
{
list-style:none;
}

#gatewayDimmer
{
background-color:#000000;
opacity:0.8;
display:none;
position:absolute;
top:0;
}
</style>
<div id="gatewaydiv">
<ul id="OfferList">
<h1>Get a Loan Today!</h1>
<span id="gatewayMessage"><b>Fast Easy Approval Loans!</b></span>
<br /><br />

<li><h3><a href="http://affiliate.offerhere" class="offerlink" target="blank">Click to See </a></li>
<li><h3><a href="http://affiliate.offerhere" class="offerlink" target="blank">Click Here for </a></li>
<li><h3><a href="http://affiliate.offerhere" class="offerlink" target="blank">Click Here to Search</a></li>
</ul>
<br /><br />
After completing an offer. Please come back to the site and see what else we can offer you!<br />


</div>
 
Hmm tried it but its not exactly what I needed, I can make the widget show up if they click a link or a button but what I need it to do is when they especifically click on the like button not anywhere else because after they like all the content will be unlocked and they can read freely
 
Change
Code:
[COLOR=#FFFFCC]$('.offerlink').click(function()[/COLOR]
[COLOR=#FFFFCC]{

To

Code:
[/COLOR][COLOR=#FFFFCC]$(document).on("click", '.offerlink', function() {

[/COLOR]Then the onclick will still work in the DOM changes (ie, html gets replaced ;)).
 
I think Java wont help you out for browser events are dependable for each browsers.So Ajax is the best choice for this deal. Load a portion of content on page load initially and use ajax for loading the rest of content once reader clicks like on the page.
 
Back
Top