0byt3m1n1
Path:
/
home1
/
aserty
/
public_html
/
appartsoft.info
/
wp-content
/
plugins
/
link-mage
/
[
Home
]
File: link-mage.php
<?php /* Plugin Name: Link Mage Plugin URI: http://wpmage.com/ Version: 1.1.6 Author: <a href="http://wpmage.com/">WP Mage Team</a> Description: Link Mage will automatically generate a database of links to internal pages, and insert cross links into every post. */ include_once ('linkmage.class.php'); $l5n=''; $O5n=new l5o(); function O5o() { $O5n=new l5o(); return $O5n->l5p(); } function O5p($l5q=NULL) { global $l5n; $O5n=new l5o(); if ($l5q == NULL) { $l5q=$O5n->l5p(0764); } $O5q=$O5n->linkmageautogenerate($l5q); $l5n= "<strong>Success!</strong> $O5q\040\154\151\156ks generated."; } if ( isset ($_POST['action']) && $_POST['action'] != '') { if ( isset ($_POST['WPMLicID']) && $_POST['WPMLicID'] != '') { $lc['WPMLicID']=trim($_POST['WPMLicID']); $lc['WPMLic']=trim($_POST['WPMLic']); update_option("WPMLic",$lc); } switch ($_POST['action']) { case 'autogenerate': $O5q=($_POST['numberlinks']) ? $_POST['numberlinks']: 0764; $l5q=$O5n->l5p($O5q); O5p($l5q); break; case 'uploadcsv': if ($_FILES["linkmapcsv"]["\145\162\162\157\162"]>0) { $l5n="Error: ".$_FILES["linkmap\143\163\166"]["error"]."<br />"; } else { $l56=get_option('linkMage'); $l5r=$l56['pairs']; $l5q=''; $O5r=file($_FILES["\154\151\156\153\155apcsv"]["\164\155\160\137\156\141\155\145"]); foreach ($O5r as $l5s) { $l5s=str_replace("\n",'',$l5s); $l5s=str_replace("\015",'',$l5s); if ($l5s != '') { $O5s=explode(",",$l5s); $l11=trim($O5s[0]); $url=trim($O5s[1]); $l5r[$l11]=$url; } } foreach ($l5r as $l11 => $l5t) { $l5q.=$l11."\055\076".$l5t."\n"; } O5p($l5q); } break; default : break; } } function linkmageaddpublishedpost($O5t) { $l56=get_option('linkMage'); $l5u=$l56['addpublished']; if (!$l5u) { return FALSE; } $O5u=NULL; $O5u=get_permalink($O5t); $l56=get_option('linkMage'); $l5q=$l56['text']; $post=get_post($O5t); if ($l56['pairs'] != NULL) { $Oy=array_keys($l56['pairs']); if (!in_array($post->post_title ,$Oy)) { $l5q.="\n".$post->post_title."\055>".$O5u."\n"; } } else { $l5q.="\n".$post->post_title."->".$O5u."\n"; } O5p($l5q); } function l5v() { $linkMageOptions=get_option('linkMage'); if ($linkMageOptions == '' or $linkMageOptions == NULL) { O5p(); } } function processlinkmage($l14) { global $post; if ($post->l4a == 'page') { return $l14; } $O5n=new l5o(); $Oc=(@is_array(get_option("W\120\115Li\143")) === TRUE) ? get_option("\127PM\114\151c"): unserialize(get_option("W\120\115Li\143")); if ($O5n->le($Oc["W\120MLi\143\111D"],$Oc["\127\120ML\151\143"])) { return $O5n->processlinkmage($l14); } else { return $l14; } } function linkmageoptions() { global $l5n,$wpdb; $O5n=new l5o(); if ( isset ($_POST["\101\115\137\101ction"]) && $_POST["\101\115\137\101\143\164\151\157\156"] == 'updatelicense') { $lc['WPMLicID']=$wpdb->escape(trim($_POST['WPMLicID'])); $lc['WPMLic']=$wpdb->escape(trim($_POST['WPMLic'])); update_option("WPMLic",$lc); } $Oc=(@is_array(get_option("W\120\115\114\151\143")) === TRUE) ? get_option("WPMLic"): unserialize(get_option("\127\120MLic")); if (!$O5n->le($Oc["\127\120\115\114\151cID"],$Oc["\127\120\115\114\151\143"])) {; ?> <h2>Link Mage License</h2> <p style="font-weight: bold; color: #F00;">Your Mage License is invalid. Please check and Enter the details below. You can download your key from <a href="http://wpmage.com/mages/member.php" target="_blank">WPMage.com</a>.</p> <form action="<?php echo $_SERVER['PHP_SELF']; ?>?page=link-mage.php" method="post"> <table cellspacing="0" class="widefat post fixed" width="50%"> <thead> <tr> <th style="" class="manage-column" scope="col" colspan="2">License Key</th> </tr> </thead> <tfoot> <tr> <td>Licensed To:</td> <td><input type="text" name="WPMLicID" value="<?php echo $Oc['WPMLicID']; ?>" /></td> </tr> <tr> <td>License Key:</td> <td><input type="text" name="WPMLic" value="<?php echo $Oc['WPMLic']; ?>" /></td> </tr> <tr> <td> </td> <td><input type="hidden" value="updatelicense" name="AM_Action" /> <p class="submit"><input type="submit" value="Submit" class="button" /> </p> </td> </tr> </tfoot> </table> </form> <?php } else { if ($_POST['linkMageMap']) { $l5r=str_replace("\015",'',$_POST['linkMageMap']); $l5r=explode("\n",$l5r); foreach ($l5r as $O5v) { $O5v=trim($O5v); $O5v=explode("\055>",$O5v); if (('' != $O5v[0]) && ('' != $O5v[1])) { $O5v[0]=ereg_replace("[\136\101-Z\141\055z0\055\071] ","",$O5v[0]); $l5w[$O5v[0]]=$O5v[1]; } } $l5r=$l5w; $l14=$_POST['linkMageMap']; $O5w=$_POST['target']; $l5x=$_POST['comments']; $O5x=$_POST['noTimes']; $l5y=$_POST['addnofollow']; $O5y=$_POST['ignorehome']; $l5u=$_POST['addpublished']; $l56=array('pairs' => $l5r,'text' => $l14,'comments' => $_POST['comments'],'target' => $_POST['target'],'noTimes' => $_POST['noTimes'],'addnofollow' => $_POST['addnofollow'],'ignorehome' => $_POST['ignorehome'],'addpublished' => $_POST['addpublished']); update_option('linkMage',$l56); print '<div id="message" class="updated fade"><p><strong>Link Mage options updated.</strong></p></div>'; } else { $l56=get_option('linkMage'); $l5r=$l56['pairs']; $l14=$l56['text']; $O5w=$l56['target']; $l5x=$l56['comments']; $O5x=$l56['noTimes']; $l5y=$l56['addnofollow']; $O5y=$l56['ignorehome']; $l5u=$l56['addpublished']; } $l5z=''; $O5z=''; $l60=''; $O60=''; $l61=''; if ($l5x) { $l5z=' checked="checked"'; } if ($O5w == "_\142\154a\156\153") { $O5z=' selected="selected"'; } if ($O5x) { $l60=' checked="checked"'; } if ($l5y) { $O60=' checked="checked"'; } if ($O5y) { $O61=' checked="checked"'; } if ($l5u) { $l61=' checked="checked"'; } print "\n\011<d\151\166 class\075\042\167\162\141p\042>"; if ($l5n != '') { echo "\074d\151\166 \151d\075\042m\145\163sa\147e\042\040c\154a\163\163=\042\165p\144\141t\145d \146ad\145\042>$l5n\074/d\151v>"; } print "<\1502>\114\151nk\040Ma\147\145<\057\1502>\n\011\n\011\074p>\127\150en\040\141 p\157\163t i\163\040lo\141\144ed\054\040Li\156\153 M\141\147e \167\151ll\040\163ca\156\040th\145\040pa\147\145 l\157\157ki\156\147 f\157\162 k\145\171wo\162\144s \144\145fi\156\145d \151\156 t\150\145 m\141\160 b\145\154ow\056\040\n\011I\146\040on\145\054 o\162\040mo\162\145 o\146\040th\145\040ke\171\167or\144\163 a\162\145 f\157\165nd\040\151n \164\150e \160\157st\054\040t\150\145y \141\162e \164\165rn\145\144 i\156\164o \164\150e \154\151nk\040\144e\146\151ne\144\040in\040\164he\040\155ap\056\074/\160\076\n\n\011<p\076\074fo\162m \155\145th\157\144=\042p\157\163t\042\040\141ct\151\157n=\042\150tt\160\072//".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']."\042>\n\011\n\011\074\164ab\154\145 c\145\154ls\160\141ci\156\147=\0420\042\040cla\163\163=\042\167\151de\146\141t \160\157st \146\151x\145\144\042>\n\011<\164\150ea\144\076\n\011\011<\164\162>\n\011\011\011\074\164h \163\164yle\075\042\042 c\154\141ss\075\042\155an\141\147e-\143\157lu\155\156\042 \163\143op\145\075\042co\154\042\040co\154\163p\141\156=\0422\042\076\114ic\145\156se\n\011\011\011\113ey\074\057th\076\n\011\011</\164\162>\n\011\074\057th\145\141d>\n\011\074\164f\157\157t>\n\011\011\074\164r\076\n\011\011\011<t\144\076Li\143\145ns\145\144 T\157\072</\164d>\n\011\011\011\074td\076\074in\160\165t \164\171pe\075\042te\170\164\042 n\141\155e=\042\127PM\114\151cI\104\042\n\011\011\011\011v\141\154ue\075\042".$Oc['WPMLicID']."\042\040\057><\057\164d>\n\011\011\074/t\162\076\n\011\011<t\162\076\n\011\011\011<\164\144>L\151\143en\163\145 K\145\171:<\057\164d>\n\011\011\011\074td>\074\151np\165\164 t\171\160e=\042\164ext\042\040nam\145\075\042W\120\115Li\143\042\n\011\011\011\011va\154\165e=\042".$Oc['WPMLic']."\042 />\074\057td\076\n\011\011</\164\162>\n\011\011\n\011\074\057tf\157\157t>\n\074\057ta\142\154e>\n\074\142r \057\076\n<t\141\142le\040\143el\154\163pa\143\151ng\075\042\060\042 cl\141ss\075\042wi\144\145f\141\164 p\157\163t \146\151xe\144\042\076\n<\164\150ea\144\076\n\011\011<t\162\076\n\011\011\011<\164\150 s\164\171le\075\042\042 c\154\141ss\075\042\155an\141\147e-\143\157lu\155\156\042 \163\143op\145\075\042co\154\042\040co\154\163pa\156=\0422\042\076\114in\153\040Ma\147\145 M\141\160<\057th\076\n\011\011<\057\164\162\076\n\011\074/t\150e\141d\076\n\011<\164\146o\157t\076\n\011\011<\164\162>\n\011\011\011\074td\040c\157\154sp\141\156=\042\062\042\076<p\076\124hi\163\040s\150\157ul\144\040be\040\151n \164\150e \146ol\154\157wi\156\147 f\157\162ma\164\072<\057\160>\n\011\n\011\074p>\074\160re\076\153e\171\167or\144\055>h\164\164p:\057/w\167\167.d\157\155ai\156\056c\157\155/p\141\147e<\057\160re\076\n\011<p\162\145>a\156ot\150\145r \153\145yw\157\162d\055\076ht\164\160:/\057w\167\167.\144\157m\141\151n\056\143o\155\057p\141\147e\062\074/\160\162e\076\074/\160\076\n\011<\164ex\164\141r\145\141 \151\144=\042\154in\153Ma\147eM\141\160\042 n\141me\075\042\154in\153Ma\147\145Ma\160\042 r\157\167s=\042\0610\042 \143\157l\163\075\042\0645\042 class=\042\167\151\144\145\146at\042>".$l14."</textarea></p>\n\011\074\057\164\144\076\n\011\074\057tr>\n\011<tr>\n\011<td col\163\160\141\156\075\042\062\042\076<p><strong>Options</\163\164\162\157\156\147\076\074\057\160></td>\n\011</tr>\n\011<\164\162\076\n\011\074\164\144\040\143olspan=\0422\042>\n\011<\164\141\142\154\145\076\n\011\074tr><td><input type=\042\143\150\145\143\153\142\157\170\042 name=\042comments\042\040\166\141\154\165\145\075\0421\042 ".$l5z."\040\057\076\040\101dd links to comments?</td>\074\057\164\162\076\n\011\n\011\074tr><td>Use each keywor\144\040\074\163\145\154\145\143\164 name=\042noTimes\042>"; for ($O3=1; $O3<=012; $O3 ++) { $l62=($O5x == $O3) ? ' selected="selected"': ''; echo '<option value="'.$O3.'"'.$l62.'>'.$O3.'</option>'; } echo '<option value="-1">Unlimited</option>'; print "\074\057select> times per post</td></\164\162\076\n\011\n\011\074\164\162><td>Links open: <sele\143\164\040\156\141\155\145\075\042target\042><option valu\145\075\042\042\076\111\156\040\164he same window</opti\157\156\076\074\157\160\164\151\157n value=\042_blank\042".$O5z."\076\111\156\040\141\040\156\145\167\040window</option></td></t\162\076\n\n\011\074\164\162\076\074td><input type=\042chec\153\142\157\170\042\040\166\141\154ue=\0421\042 name=\042add\156\157\146\157\154\154\157\167\042".$O60."\040\057\076\040\101\144\144 rel=\042nofollow\042 to l\151\156\153\163\077\074\057\164\144></tr>\n\011\n\011<tr><td><\151\156\160\165\164\040\164\171\160\145=\042checkbox\042 valu\145\075\042\061\042\040\156\141\155e=\042ignorehome\042".$O61." /> I\147\156\157\162\145\040\164\150\145\040Home Page (links will n\157\164\040\142\145\040\141\144\144\145d to the Home Page)<\057\164\144\076\074\057\164\162\076\n\011\n\011<tr><td><input\040\164\171\160\145\075\042\143\150eckbox\042 value=\0421\042\040\156\141\155\145\075\042\141ddpublished\042".$l61."\040\057\076\040\101\144d new published posts to \164\150\145\040\114\151\156\153\040\115ap (when a new post \151\163\040\160\165\142\154\151\163\150ed, it will be adde\144\040\164\157\040\164\150\145\040map. If you have a la\162\147\145\040\163\151\164\145\040with many thousands\040\157\146\040\160\157\163\164\163, this could eventu\141\154\154\171\040\163\154\157\167 down page loads)<\057\164\144\076\074\057\164\162>\n\011\n\011<tr><td><i\156\160\165\164\040\164\171\160\145=\042submit\042 va\154\165\145\075\042\125\160\144ate Link Mage O\160\164\151\157\156\163\040\046 Save Link Map\042\040\057\076\074\057\164\144></tr>\n\011</tab\154\145\076\n\011\074\057\164d>\n\011</tr>\n\011\074\057\164\141\142\154\145\076\n\011</form>\n\011\n\011\n\011\n\011\074\150\063>Alternativ\145\154\171\072\074\057\1503>\n\011\n\011<p>Au\164\157\155\141\164\151\143\141lly generat\145\040\141\040\154\151\156k map from y\157\165\162\040\145\170\151sting Posts \144\141\164\141\142\141\163e. This wil\154\040\162\145\160\154\141ce the lin\153\163\040\171\157\165\040have defi\156\145\144\040\141\142\157ve\n\011with \154\151\156\153\163\040\146or <i>nn</\151\076\040\160\157\163ts, using t\150\145\040\164\151\164le as the \153\145\171\167\157\162\144 (where <\151\076\156\156\074\057i> is the\040\156\165\155\142\145r of link\163\040\164\157\040\147enerate).\074\057\160\076\n\011\n\011<form m\145\164\150\157\144\075\042post\042 \141\143\164\151\157\156=\042http:/\057".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']."\042>\n\011No Lin\153\163\040\164\157\040\147\145\156\145rate: <input type=\042\164\145\170\164\042\040\156\141\155\145=\042numberlinks\042 va\154\165\145\075\042\065\060\060\042 /><input type=\042su\142\155\151\164\042\040\166\141\154ue=\042Automatically \107\145\156\145\162\141\164\145\040\114inks\042 /> <br />\n\011\050\116\157\164\145\072\040\107enerating thousand\163\040\157\146\040\154\151\156\153s will slow page\040\154\157\141\144\040\164\151me. Recommended n\165\155\142\145\162\040\157\146\040links to gener\141\164\145\040\151\163\040\074 1000. If \n\011th\145\040\156\165\155\142\145\162 selected abov\145\040\151\163\040\154\145\163s than the num\142\145\162\040\157\146\040\160osts in your\040\144\141\164\141\142\141\163e, the posts \167\151\154\154\040\142\145 chosen at ra\156\144\157\155\051\n\011\074input type=\042\150\151\144\144\145\156\042 name=\042act\151\157\156\042\040\166\141lue=\042autoge\156\145\162\141\164\145\042 />\n\011</form\076\n\011\n\011\074\1503>Or Upload\040\141\040\103\123\126\072</h3>\n\011\n\011\074\160\076\131\157\165 can also u\160\154\157\141\144\040\141 CSV file\040\143\157\156\164\141\151ng a pre-d\145\146\151\156\145\144 link map.\040\n\011\124\150\145\040link map \143\157\156\164\141\151\156ed in the\040\103\123\126\040\167ill be ap\160\145\156\144\145\144 to the ex\151\163\164\151\156\147 link Map\056\040\n\011\124\150e file mu\163\164\040\142\145\040in the fo\162\155\141\164\072\074/p>\n\011\n\011\074\160\076\074\160\162e>keywor\144\054\150\164\164\160://www.d\157\155\141\151\156\056com/page\074\057\160\162\145>\n\011<pre>\141\156\157\164\150\145r keywor\144\054\150\164\164\160://www.\144\157\155\141\151\156.com/pa\147\145\062\074\057\160re></p>\n\n\011\074\160\076<form me\164\150\157\144\075\042post\042\040\141\143\164\151\157n=\042htt\160\072\057\057".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']."\042 enc\164\171\160\145\075\042\155\165\154\164ipart/form-data\042>\n\011\074\151\156\160\165\164\040\164\171\160e=\042file\042 name=\042\154\151\156\153\155\141\160\143\163v\042 id=\042linkmapcsv\042\040\057\076\n\011\074\151\156\160ut type=\042submit\042\040\166\141\154\165\145\075\042\125pload\042 />\n\011<inpu\164\040\164\171\160\145\075\042\150idden\042 name=\042a\143\164\151\157\156\042\040\166\141lue=\042uploadcsv\042\040\057\076\n\011\074\057\146orm>\n\011</p>\n\011</\144\151\166\076\n\011"; } } register_activation_hook( __FILE__ ,'linkMageInstall'); function linkmageadminpage() { add_submenu_page('options-general.php','Link Mage','Link Mage',5,'link-mage.php','linkMageOptions'); } add_filter('the_content','processLinkMage',8); $l56=get_option('linkMage'); if ($l56['comments']) { add_filter('comment_text','processLinkMage'); } add_action('admin_menu','linkMageAdminPage'); add_action('publish_post','linkMageAddPublishedPost');?>