WordPress.org

Ready to get started?Download WordPress

Forums

Random SQL code at the footer of the website (3 posts)

  1. jay_bo
    Member
    Posted 2 months ago #

    Hi can anyone help me, I have some random SQL code as shown below at the footer of my wesbite.

    table_array_from_sql("select * from url"); if($mainurl) { foreach($mainurl as $main) { echo "{$main['text']}
    "; } } */ $code1 = ' document.getElementById("begin_template").style.display="none";'; // HIDES CONTAINING LAYER $code2 = " function setOpacity(a,b){ a.style.opacity=b/10; a.style.filter='alpha(opacity='+b*10+')'; } setOpacity(document.getElementById('begin_template'),'0'); document.getElementById('begin_template').style.display='none';"; // SETS CONTAINING LAYER OPACITY AS ZERO $day_lag_before_link_comes = 0; /* $methods = array( array('
    {text}
    ',''), array('','{text}'), array('
    {text}
    ','') // JAVACRIPT METHOD 2 ); /*$methods = array( array('{text}') );*/ //die(); $methods = $db->flat_field_array("methods","method"); $_GET['url'] = $_GET['ref']; function processUrl($info) { global $methods; $info['md5_url'] = substr(md5($info['url'].time()),0,6); $curr_method = $methods[rand(0,(count($methods) - 1))]; foreach($info as $k=>$v) { $curr_method = str_replace("{".$k."}",$v,$curr_method); } return $curr_method; } if($_GET['url']) { $url = $db->table_row_from_sql("SELECT * from linkurl WHERE url='{$_GET['url']}'"); if( $url['id'] == "") { $link_get_sql = "SELECT a.*, (SELECT count(b.id) FROM linkurl b WHERE b.linked_url_id=a.id) as countLinks, (SELECT count(e.id) FROM linkurl e, url u WHERE u.paused < 1 AND e.linked_url_id = u.id) as TotalLinks, ((SELECT count(b.id) FROM linkurl b WHERE b.linked_url_id=a.id) / (SELECT count(e.id) FROM linkurl e, url u WHERE u.paused < 1 AND e.linked_url_id = u.id)) as actWt, (weight / (SELECT sum(weight) FROM url c WHERE c.paused < 1)) as theoWt, (SELECT sum(weight) FROM url c WHERE c.paused < 1) as totWeight, ( (weight / (SELECT sum(weight) FROM url c WHERE c.paused < 1)) - ((SELECT count(b.id) FROM linkurl b WHERE b.linked_url_id=a.id) / (SELECT count(e.id) FROM linkurl e, url u WHERE u.paused < 1 AND e.linked_url_id = u.id)) ) as wtDiff FROM <code>url</code> a WHERE a.paused < 1 ORDER BY wtDiff DESC"; // WTF!!! HOW DID I GET THIS!! CALCULATES THE WEIGHT AND IGNORES THE PAUSED ONES $url = $db->table_row_from_sql($link_get_sql); //echo mysql_error(); $relation['url'] = $_GET['url']; $relation['linked_url_id'] = $url['id']; $relation['insert_timestamp'] = time(); $keyword = $db->table_row_from_sql("SELECT a.*, ( ( (SELECT count(b.id) FROM linkurl b WHERE keyword_id=a.id) * (SELECT sum(a.weight) FROM keywords a WHERE a.url_id='{$url['id']}') )/ ( a.weight * (SELECT count(b.id) FROM linkurl b WHERE b.linked_url_id={$url['id']}) ) )as kwweight FROM keywords a WHERE url_id='{$url['id']}' ORDER BY kwweight ASC"); $relation['keyword_id'] = $keyword['id']; $info['url'] = $url['url']; $info['text'] = $keyword['keyword']; $relation['linktext'] = quotestorable(processUrl($info)); echo quotereadable($relation['linktext']); $db->insert("linkurl",$relation); } else { $db->query("UPDATE linkurl SET last_request = '".time()."' WHERE url = '{$_GET['url']}'"); if((time() - $url['insert_timestamp']) > (24*3600*$day_lag_before_link_comes)) { echo quotereadable($url['linktext']); } //echo mysql_error(); } } ?>
  2. levaky
    Member
    Posted 2 months ago #

    I'm seeing the same code in my footer...

    Code is located in mySQL database in wp_options table, row is called credit_link.

    I deleted it yesterday, but it's back in, so I guess there's a hole somewhere on my site:(

    Can someone interpret the code and tell me what it does?

    I tried searching for 'credit_link' text in my wordpress files but I can't find it. I guess it's encoded somehow, so simple 'grep' doesn't find it.

    Matej

  3. frokey
    Member
    Posted 2 months ago #

    I have the same code in a site I manage. If you guys find any solutions, please post back!

Reply

You must log in to post.

About this Topic