Jump to content

Forums

  1. Welcome

    1. Announcements & News

      Prodjex News, Announcements and site rules.  Only administrators may create threads, but everyone can read and reply.

      558
      posts
    2. New Arrivals

      If you are new here, this is a good place to start!

      892
      posts
  2. Web Development

    1. Programming

      Anything related to programming such as PHP, ASP, Javascript, .NET, C# ect...

      1,031
      posts
    2. Database Development

      Dedicated to database and SQL related topics (MYSQL, Microsoft SQL Server, Oracle, MS Access and more)

      117
      posts
    3. Server Administration

      Need help with server administration? Things like mod_rewrite, .htaccess, Apache configuration, and Hosting are discussed here.

      801
      posts
    4. Hosting & Domains

      For discussion related to any hosting or domain registration, transfers, reselling, etc.

      807
      posts
    5. Frameworks

      Discussion on any and all types of web frameworks.

      1,154
      posts
  3. Web Design

    1. HTML & CSS

      Place to talk about website design and get help with HTML, CSS, HTML5, CSS3, Bootstrap, etc...

      595
      posts
    2. Graphics & Multimedia

      For anything related to graphics, video, sound, etc...

      524
      posts
  4. Desktop Discussion

    1. Linux Development

      Linux forum is for discussing topics including usage, troubleshooting, modules, and distributions. Linux is an open source OS, based on UNIX.

      266
      posts
    2. Windows Development

      Windows forum is for discussing tips, tricks, configurations, and more. Microsoft Windows is one of the most popular operating systems due to its ease of use.

      1,172
      posts
    3. Mac/Apple Development

      Mac/Apple forum is for discussing problems, tips and configuration for all Mac operating systems including Mac OS X. All Apple computers are covered here.

      312
      posts
    4. Hardware Discussion

      Computer Hardware forum discussing topics and issues such as monitors, memory, hard drives, CPU's, motherboards, etc. Find information and help to keep your computer running smoothly.

      974
      posts
  5. Marketing & Business

    1. Advertising, Marketing, Monetization & Social Media

      Discussion about how to utilize social networks and general marketing related topics.

      1,323
      posts
    2. Search Engine Optimization & Traffic Building

      Search Engine Optimization Makes Your Website Irresistable To Spiders! Techniques and Tips on How To Increase Your Site's Search Engine Rankings and Traffic.

      1,219
      posts
    3. Buy, Sell or Trade

      Market place for buying, selling or trading services, products, etc. You must have 25 posts to create a new sale.

      345
      posts
  6. Prodjex Applications and Tools

    1. 169
      posts
    2. Web Tools

      A plethora of free web tools created and hosted by Prodjex. Share them! Have a question about the functionality of one? Post your questions here.

      12
      posts
  7. The Developer Dump

    1. General Chat

      General chat forum discussing anything that doesn't fit into the other forums. This is a place to relax, talk, and even have some friendly debate.

      3,859
      posts
  • Forum Statistics

    1,795
    Total Topics
    16,599
    Total Posts
  • Who's Online   0 Members, 0 Anonymous, 0 Guests (See full list)

    There are no registered users currently online

  • Topics

  • Leaderboard

    Member Total Points
    1 Nathan 174
    2 ciamciaj 26
    3 Tony 15
    4 Marc 2
    5 West41 2
  • Posts

    • Last week we wrote a blog post on how to disable right click functionality on an entire website.  Since then we've had a few requests on how you would apply this same method to a certain area, container or element on your website or webpage. The code is almost identical, you just have to modify the listener so that it only fires based on certain CSS selectors. Here's the entire page's code: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content="Example of how to disable right click on specific sections of a website using Javascript and a Bootstrap Modal"> <meta name="author" content="Projex"> <title>Bootstrap and Javascript Right Click Disable Element Based Example | Prodjex Web Development and Consulting</title> <link href="../css/bootstrap.min.css" rel="stylesheet"> <link href="../css/pricing.css" rel="stylesheet"> <style> body{background-color: grey;} p{color: #fff;} </style> </head> <body> <div class="d-flex flex-column flex-md-row align-items-center p-3 px-md-4 mb-3 bg-white border-bottom box-shadow"> <h5 class="my-0 mr-md-auto font-weight-normal"><img src="https://www.prodjex.com/wp-content/uploads/2017/10/dsmall.png"/></h5> <nav class="my-2 my-md-0 mr-md-3"> <a class="p-2 text-dark" href="#">Features</a> <a class="p-2 text-dark" href="#">Enterprise</a> <a class="p-2 text-dark" href="#">Support</a> <a class="p-2 text-dark" href="#">Pricing</a> </nav> <a class="btn btn-outline-primary" href="#">Sign up</a> </div> <div id="disableRC" class="pricing-header px-3 py-3 pt-md-5 pb-md-4 mx-auto text-center"> <div class="col-md-12"> <h1 class="display-4">Right click here...</h1> <p class="lead">Example of how to disable right click on specific sections of a website using Javascript and a Bootstrap Modal.</p> </div> </div> <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Warning</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> </div> <div class="modal-body"> Don't do that! </div> <div class="modal-footer"> <button type="button" class="btn btn-primary" data-dismiss="modal">I Understand</button> </div> </div> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script> <script> $('#disableRC').on('contextmenu', function () { $('#exampleModal').modal('show'); return false; }); </script> </body> </html> The code we've changed is within the JavaScript, instead of looking at the entire document, we're now only looking at firing the event if the right click happens within the "disableRC" element. <script> $('#disableRC').on('contextmenu', function () { $('#exampleModal').modal('show'); return false; }); </script> You can check out the demo here. View the Prodjex Web Development Blog post on How to Disable Right Click on Specific Area of a Website.
    • I know this is a pretty basic thing, but I've seen so many tutorials out there that are non-dynamic solutions. Normally when you google "How to force HTTPS using an .htaccess file" or "Redirect HTTP to HTTPS using an .htaccess file" you get examples like the below. RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.example.com/$1 [R,L] This does work, but you have to replace www.example.com with your domain and it's then hard-coded and not dynamic.  I don't like hard-coding anything unless it's absolutely necessary, so here's an example of the dynamic way to redirect to https from http requests using your htaccess file. RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] View the Prodjex Blog post on How To Force HTTPS Using .Htaccess.
    • This is an example of how to disable right clicking on a website using JavaScript and Bootstrap. You could leave Bootstrap off completely and use the basic alert functionality, but it's not as clean looking to the end user and limits some of the customization. The following is the JavaScript code used to listen and catch the right click action anywhere on your page.  When a user right clicks it shows the Bootstrap Modal and stops the right click function from firing. <script> $(document).on('contextmenu', function () { $('#exampleModal').modal('show'); return false; }); </script> Below is the script inserted on an example page.  You can view the demo of it in action here. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content="Example of how to disable right click on a website using Javascript and a Bootstrap Modal"> <meta name="author" content="Projex"> <title>Bootstrap and Javascript Right Click Disable Example | Prodjex Web Development and Consulting</title> <link href="../css/bootstrap.min.css" rel="stylesheet"> <link href="../css/signin.css" rel="stylesheet"> <style> body{background-color: grey;} p{color: #fff;} </style> </head> <body class="text-center"> <div class="container"> <div class="col-md-12"> <img src="https://forums.prodjex.com/uploads/monthly_2017_12/5a49485fa77dd_logobig.png.0c19c7fc9cc393df1ad69f5ec30877c1.png"><br><br> <p>Right click on this page...</p> </div> </div> <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Warning</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> </div> <div class="modal-body"> Don't do that! </div> <div class="modal-footer"> <button type="button" class="btn btn-primary" data-dismiss="modal">I Understand</button> </div> </div> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script> <script> $(document).on('contextmenu', function () { $('#exampleModal').modal('show'); return false; }); </script> </body> </html> Keep in mind just because you disable the right click functionality on your website doesn't mean your content is safe.  There are many other methods someone with the right knowledge could use to download media assets or copy text from your website.  If you don't want your assets copied or downloaded then don't put it on the internet to begin with. View the Prodjex Web Development Blog post on How to disable right click on a website using JavaScript and a Bootstrap Modal.
    • What's New in Version 1.0.15 - 02-13-2018 New functionality to filter which user groups should be included/excluded from contests.
  • Recent Status Updates

  • Member Statistics

    • Total Members
      1,501
    • Most Online
      3

    Newest Member
    ciamciaj
    Joined
×