FarrisFahad 103 Junior Poster

How do you make the whole image with black transperent and the selected part has no opacity?

FarrisFahad 103 Junior Poster

I am working on an image cropper. And I am on the first stages. I want to know how to create the the two divs over the image, one is transperent while the other acts as a mask.

Can this be done with CSS? Or should I consider jQuery?

This is what I want to accomplish ...

Croppr_js.png

I just want to know how to create this overlay image feature.

FarrisFahad 103 Junior Poster

Okay guys thank you for your help :)

FarrisFahad 103 Junior Poster

I haven't used jQuery Mobile for clicks rather jQuery. There might be something wrong with my code, but it does work on Android.
I use an old version of jQuery, does that matter. Is mobile clicking supported for old versions of jQuery?
I currently use jQuery "jquery-1.12.0.min.js". Should I upgrade?

FarrisFahad 103 Junior Poster

I have jquery for my mobile website, but the problem is with iPhones. The touch event, or onclick event does not work on iPhones. It works on Android.

Have anyone encountered the same problem? How can I fix this? Are there any work arounds?

Also I am a bit confused about jQuery Mobile. What is the purpose of this framework other than the swipe events?

Should I add both jQuery and jQuery Mobile for my mobile site?

FarrisFahad 103 Junior Poster

You need to be where your audience are. If you are building crappy and spammy links it won't help with your SEO.

You need to think of marketing as promoting rather than building spamy links that won't get you anywhere.

FarrisFahad 103 Junior Poster

You don't have to do SEO if you have valuable content. Bad content requires consistent SEO, while great content markets it self.

When I say great content I mean great user experience. Was the user satisfied with the page he or she visited? Did they get what they want? Are they coming back? These are all things you should consider.

And no, you don't need to do SEO continuasely.

I heard a great quote from Income School channel on YouTube ...

If you are gonna put hours of work into SEO. You would be better off optimizing and improving your content.

You know, links aren't everything to Google. They look into user behavior too.

Just my 2 cents. :)

rproffitt commented: "Bad content requires consistent SEO" +15
FarrisFahad 103 Junior Poster

Thanks a lot @jkon for this helpful information. I will need to look more into it.

FarrisFahad 103 Junior Poster

Can you at least answer the question? I want to learn the basics first.

FarrisFahad 103 Junior Poster

Thank you @Vijay for your help.

FarrisFahad 103 Junior Poster

I want to protect my site from hacking. Currently I know about XSS and SQL injection.

Do I need to use mysqli instead of mysql? And why?

When should I use htmlentities() and striptags()?

I also don't want users to upload melicious files and since I accept file uploading, is it enough to check file type? If not what can I do to prevent this?

My website runs on PHP, is there anything else I should worry about?

FarrisFahad 103 Junior Poster

Hey guys, I have found the solution to my problem ...

With htaccess redirect you need to specify the full url of the destination redirct. This is what I did ...

RewriteCond %{REQUEST_URI} !^/mobile/.*$
RewriteRule ^(fresh|trending|hot|featured|users|rooms|languages|comments|register|login)$ https://www.picturepunches.com/mobile/$1 [L,R=302]
FarrisFahad 103 Junior Poster

Yes, but I want to get their timezone even if they were using a VPN, or whatever. Is there an effeciant way?

FarrisFahad 103 Junior Poster

I have a unix timestamp for each cooment in my database. I want to output the user date and time depending on their location, or timezone.

How do I do that properly?

FarrisFahad 103 Junior Poster

I already worked on this project. I might take your advice later but for now can anyone help?

FarrisFahad 103 Junior Poster

Here is the code I currently have ...

RewriteEngine on

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteRule ^(trending|hot|featured|users|rooms|languages|comments|register|login|forgot-password|upload|contact|learn|rules|thanks)$ $1.php [NC,L]
RewriteRule ^member/(feed|subscriptions|pictures|earnings|advertise|settings|crop-picture|create-ad|create-room|manage-rooms)$ $1.php [NC,L]

RewriteRule ^mobile/(fresh|trending|hot|featured|comments|users|rooms|languages|upload|register|login|forgot-password|learn|rules|contact|thanks)$ mobile/$1.php [NC,L]
RewriteRule ^mobile/member/(feed|subscriptions|pictures|earnings|advertise)$ mobile/$1.php [NC,L]

RewriteRule ^(trending|hot|featured|users|rooms|languages|comments|register|login|forgot-password|upload|contact|learn|rules|thanks)$ mobile/$1 [L,R=301]
FarrisFahad 103 Junior Poster

Can someone please edit the last 2 lines to make it work? Make sure that you read the first post.

FarrisFahad 103 Junior Poster

Here is what I have come up with ...

RewriteCond %{QUERY_STRING} !^desktop
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|googlebot-mobile|iemobile|iphone|ipod|#opera mobile|palmos|webos" [NC]
RewriteCond %{HTTP_USER_AGENT} "acs|alav|alca|amoi|audi|aste|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "dang|doco|eric|hipt|inno|ipaq|java|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT}  "maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|opwv" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "palm|pana|pant|pdxg|phil|play|pluc|port|prox|qtek|qwap|sage|sams|sany" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|w3cs|wap-|wapa|wapi" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "wapp|wapr|webc|winw|winw|xda|xda-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "up.browser|up.link|windowssce|iemobile|mini|mmp" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "symbian|midp|wap|phone|pocket|mobile|pda|psp" [NC]
RewriteCond %{REQUEST_URI} !^/mobile/.*$
RewriteRule ^(.*)$ /mobile/ [L,R=302]
FarrisFahad 103 Junior Poster

I want to redirect my users to my mobile site. My mobile site is in a subfolder instead of a subdomain. Here is how I want it to work ...

Request sent to:
https://www.picturepunches.com/hot

Redirect to:
https://www.picturepunches.com/mobile/hot

I also don't want to effect the images on that page. So I want the images to be:
https://www.picturepunches.com/pictures/user/1937/19974-Theosawmon.jpg

And not:
https://www.picturepunches.com/mobile/pictures/user/1937/19974-Theosawmon.jpg

How can I do dis?

FarrisFahad 103 Junior Poster

My advertising system allow my users to earn from their uploads, this is why I built it myself. But I am still facing problems with targeting. I just hope that one day people will start to buy ad credit.

FarrisFahad 103 Junior Poster

Thank you the second article helped, Sorry I guess I was looking for something simpler than link 1.

pty commented: I'm glad it helped +9
FarrisFahad 103 Junior Poster

Okay here are some solutions I have come up with to give you an idea of what I want ...

SELECT * FROM pictures WHERE (votes * 0.60) >= (SELECT AVG(votes) FROM pictures) ORDER BY date DESC LIMIT 15

Let me explain the code above: I am selecting the top 60% pictures according to average votes for all pictures, and ordering them according to timestamp.

But the problem with the SQL above is that, like @alan.davies said, this will sort according to votes not date.

I want to come up with a way to sort today's funny pictures first, then yesterday, then the day before, etc ...

SELECT * FROM pictures WHERE (votes_up - votes_down) >= (SELECT AVG(votes_up - votes_down) FROM pictures WHERE uploaded_timestamp >= time() - (60*60*24*7)) ORDER BY uploaded_timestamp DESC LIMIT 15 

The code above will get you pictures that have a score above or equal to average score for pictures in the last 7 days ordering them by date

I think the main question here is how do I sort according to date first, then votes or score.

The problem with date is that it's a timestamp which means it's changes every second. This will cause the sorting to be according to date and not date + votes.

Do you have any idea how to solve this?

FarrisFahad 103 Junior Poster

I send payments to my users regularly. But sometimes the user enter a PayPal email address that cannot receive money from other PayPal users. They just can receive money from their website.

How can I check for this and show an error to the user? Do I need to use PayPal IPN, or API? And how?

FarrisFahad 103 Junior Poster

This is where it's tricky. I want to display best images for today and all days. I just don't know the SQL algorythm. This is why I am asking.

FarrisFahad 103 Junior Poster

You still don't understand the question. I already have a website similar to 9Gag, but I want to replicate their voting system. I don't know the algorythm. I don't want to build a clone site like 9Gag. But thank you for your reply.

rproffitt commented: That's a good question. Most likely secret sauce. Or in those scripts you buy. +15
FarrisFahad 103 Junior Poster

Here is something I am looking for ...

mysql_query("SELECT * FROM pictures WHERE (up_votes - down_votes) * 0.6 > average_votes ORDER BY date DESC LIMIT 15");

I am looking for a query that sort hot and trending pictures. I was thinking that "hot" could be amongst the top 60% and trending above 30%.

What do you think? Is there a better way.

FarrisFahad 103 Junior Poster

What does funding have to do with voting system? I am asking about the way to code a voting system like 9Gag with MySQL and PHP.

FarrisFahad 103 Junior Poster

I have a database of pictures, and votes. The pictures database has up_votes and down_votes culomns. I want to create a system using MySQL to get hot and trending pictures just like 9Gag.
How can I do that?

FarrisFahad 103 Junior Poster

It's my competition.

I see, so if Facebook is dead where should I promote my site? Do you have any suggestions?

FarrisFahad 103 Junior Poster

I see a lot of people having success with Facebook. Espacially in my niche, memes. But I find it hard to drive traffic from Facebook for free to my current followers.

I have a business page that has 24,000+ followers.But I only get less than a hundred reach on any single post.

Is Facebook marketing dead? Or am I doing it all wrong? I have no idea.

I don't want to pay evertime I want to reach my audience.

What do you guys think?

FarrisFahad 103 Junior Poster

Thank you @AndrisP,

I have found a great solution ...

I used Cronjobs to excute a php file each day. Thank you very much for the help :)

For those who have the same problem. Here is what I did:

  1. Learn about Cronjobs, it's very simple just like htaccess but for timly tasks.
  2. Write your PHP file path in the cronjob command.
  3. Create a record everyday for all users.

You also should know that your hosting provider may have a cron option that can create and delete crons.

Farris :)

FarrisFahad 103 Junior Poster

I want to calculate the earnings of all users every day. But I don't know how to track them daily. I know how to program PHP and MySQL, but I don't know how professionals do it.

FarrisFahad 103 Junior Poster

I let users earn money through my site, and I want to record their daily earnings.

I want to record their earnings starting from 00:01am

I don't know how to do this using PHP and MySQL.

I know how to create, update, etc database. But I am streuggling with PHP time.

I don't know how to create a database row for each user at the start of the day and then update their earnings until the end of the day.

Here is what I have come up with ...

<?php

$time = '00:01';
$day = 11;
$month = 3;
$year = 2018;

strtotime("{$month} {$day} {$year} {$time}");

// The above function will return a timestamp

What do you think?

FarrisFahad 103 Junior Poster

Got it :)

Thank you guys for your responses, DaniWeb users are really helpful :)

Farris

FarrisFahad 103 Junior Poster

Okay guys, thank you all for your response. I am working on my queries and code right now and minimizing database requests. I want to be ready incase I got a lot of visitors, that's it. I tried searching on Google, but I could not find an answer ...

Do you think I can hire someone to do this for me on Upwork or any other freelancing website?

Because I contacted my hosting provider and they have no clue on how to do it, software or hardware wise.

FarrisFahad 103 Junior Poster

Hi Dani,

To answer your questions, I am not using any third party software to manage the bidding. The ads are CPM based. And yes it is easy to create an ad campaign, in fact it's very easy. And no I am not selling links.

Because there are no targeting, I am worried that my advertising system is not good enough for advertisers. And I am not sure who should I target as an advertiser. Any ideas would be much appreciated.

Farris

FarrisFahad 103 Junior Poster

My funny pictures website has an advertising system that is basic. I want to improve it to attract more advertisers.

Currently you only need a 728px by 90px a image, a link and your bid. The higher the bid the faster the results and the cost is obviously higher.

It's very simple. I don't get a lot of hits now, but when I do I want to be ready. Can you help me come up with great ideas for advertisers?

Here is what I came up with ...

  1. Make ads like PTC websites where users earn for clicks.
  2. People can review websites that are advertising, so that the advertiser gets feedback for his website.

Do you have any other ideas?

FarrisFahad 103 Junior Poster

I was just learning about load balancers, and I found that it's a peice of hardware, and it could be a software too. So there are too options. What do you think is better?

By the way I am hosting the site on Hostgator.

And thank you very much ryantroop :)

FarrisFahad 103 Junior Poster

The site has MySQL database. The database does not have a lot of tables, though some tables have a lot of records. Thanks for advice I will optimize my database, I think that it's where the problem rise.

The site is about memes by the way. I guess you know how much traffic these sites get. I just discovered that my site cannot handle more than 150 users at a time. I usually get about 190+.

I am still learning about load balancers and cache. Thanks for that too :)

FarrisFahad 103 Junior Poster

I built the site myself using PHP as a server side language. I know that there is a lot of processing going on, so now I am trying to optimize my pages for less processing. But I am expecting a lot of traffic in the following year or so, so I have to be ready.

FarrisFahad 103 Junior Poster

Thanks. Should I ask my hosting provider to do it for me, or should I do it myself? Because I contacted them and they told me that I need to do it myself, but it seems like it's a job they are responsable for. Don't you think?

FarrisFahad 103 Junior Poster

I have a website that gets a lot of visitors a month. And the server cannot handle the traffic. I have a dedicated server. How can I run the site on multiple dedicated servers?

FarrisFahad 103 Junior Poster

I read about a lot of people who ranked their site without building a single link. Does posting great content or building a great site can get you ranked higher? What if I'm in a competitive niche, do I need to build links? Or should I post my content to Social Media and wait for links to be built?

logan_paul commented: Yup its true you can rank your website just by writing unique article. Its all about user intent. If the intent is good he will read the content. +0
optimiserteam commented: yeah,it can be possible when your article's unique and done a best On page seo +0
coolgear commented: Website may rank in google but not for long run. For stability in Google one must create high authority backlinks. +0
jstech001 commented: yes it is possible but it takes alot of time +0
FarrisFahad 103 Junior Poster

After I updated my wordpress I got a lot of 404 on my Google Analytics account eventhough pages are working just fine. Can anyone help me?
Here is my site: Click Here

It does not happen for all pages, only few. I don't want to lose organic traffic.

Have you had the same problem before?

Farris

FarrisFahad 103 Junior Poster

When I said advertise I meant using Facebook. I did not buy any fans. None of my fans are fake.

FarrisFahad 103 Junior Poster

Let me tell you what I have been upto so you can get a better understanding ...

When I first started back in January 2015 I aimed to get a good backlink profile for a better ranking. But my problem is that I targeted the wrong keywords, and for that after a few months, eight to be exact, I stopped SEO because I was not getting a good amount of traffic, I was targeting 100 visitors a day and I got less than 10 a day. But I did not stop with SEO there. I continued but with an offshore company, Indian. And they built spammy links till the website ranking dropped. So I hired someone else, and they too started posting bad content for the sake of links which brought my ranking further down. Then and then only I stopped doing SEO, and I thought why not switch to Social Media???

I created a Facebook business page, and a Pinterest account. I did not want to spread myself thin working on all Social Media websites so I focused on those two. I saw that 9Gag had a lot of success with Facebook. And another website called 'dump a day' that had a lot of traffic from Pinterest.

So when I first started with Facebook I spent money on advertisement to gain 3500 likes. And I started posting funny pictures. But the problem was that less than 20% of my fans interacted with my posts, that's before Facebook brain algorythm. …

FarrisFahad 103 Junior Poster

Hi Dani,

My website offer the visitor the ability to make money from uploading pictures, well funny pictures. The funnier you are the more money you'll make. And that is done by picture and ad impressions. The more subscribers you have the more money you'll make. What did you understand when you first visited the website? What was your first impression?

rprofitt,

Are you saying that it may take 5 years to build an audience? If so, why does it take 5 years? How do most Facebook pages get their fans? I don't buy fans, I advertise to get them, so there are no fake fans.

To all,

I recently found an interesting method, and that is boosting posts. From boosting posts I get engagement, fans, and traffic to my site. But at a low level. I am waiting for my posts to go viral. I haven't had any viral posts yet. So this means I don't know the result, but I think it's gonna be good.

rproffitt commented: Did you try a few good images on Imgur and Reddit? +12
FarrisFahad 103 Junior Poster

I am currently working with two Social Media sites. Facebook, and Pinterest. But there seems no way around paying for traffic. I don't want to pay for traffic. I post from time to time but I see no growth neither in fans nor in website visitors.

Here are my Social Media pages:
Facebook: https://www.facebook.com/PicturePunches/
Pinterest: https://www.pinterest.com/PicturePunches/

With Facebook, my strategy is to post funny pictures found on my site. To be honest I don't post daily. And my content can be found on other social media pages. I got some fans from advertising, about 3500. And my post impressions is about 1000. I am also particepating in some groups related to my niche. When I post to any group I hardly get traffic. Like 1 or 2 visitors.

Can you check the page and tell me what am I doing wrong, or you can suggest a way for my page to improve.

And with Pinterest, my only strategy is to follow people so they can follow me back, I know it's lame but it's free. Currently I have about 37 followers. Can you check the page and see my content and tell me if it is of high quality?

FarrisFahad 103 Junior Poster

Thank you, canadafred for your response. So you say I should not build links? But why? I cannot rank. How else should I promote my website?

FarrisFahad 103 Junior Poster

I want to build links to my website, but I am facing a problem. I can't seem to find a lot of websites for backlinks. I don't know how SEOers do it. I have joined Alexa, and gone through my compatition backlink profile so I could find opportunities, but I didn't. I went through 100s of backlinks, but they all seem to be from an relavent websites that is in another language.

Is there any way for me to find link opportunities? How do you do it?