Code Monkey home page Code Monkey logo

drupal-href-src-viewer's Introduction

drupal-href-src-viewer

A script that looks through drupal 6's node revisions table and gets all of the src and href attributes to help you find unwanted absolute links, hot-linked images, and images embedded in page nodes.

To use this script you must be at least partially familiar with php because configuration is handled baked into the source code.

To Use

  1. Edit line 37 to match your database parameters. I would recommend creating a select only database user so you know for sure that this script will not write to your database.
  2. You will probably want to change the function printMatches() on line 81 to fit your site. This function does the heavy lifting of adding classes based on criteria, so you will need to edit this function (and the css) to make it look the way you want. $classes[] is an array of class names to add to the list items. Since we wanted to see images that were being served from an old webserver 'www', we check to see if the src or href contains www.saintmarys.edu on line 84 and if it does, we add a class of www.
  3. Alter the key on line 140 to fit your needs.
  4. Lines 172-178 make calls to printFilesAndImagesFromDB(). The function takes a one element array where the key is the database name and the value is the path to where that install is located. So if you have a database called foo where the sites is located at foo.example.tld you would call printFilesAndmImagesFromDB(array('foo'=>'foo.example.tld'));
  5. Alter the css as you see fit to help you visualize the output.

Gotchas

If your nodes have multiple revisions, every revision will be shown in this script.

drupal-href-src-viewer's People

Contributors

patrick-mcdougle avatar danielmill3r avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.