![]() | |
| |||
| wpde konu içinde verdiğim kodların işlenmeyerek ve renklendirilmesini nsl sağlarım. örnek : Wordpress üstündeki son yazıları html sayfanızda gösterin - Günlük Haftalık Aylık PLAIN TEXT yazan yer gibi yapmak istiyorum. tşk.
__________________ $ |
| ||||
| varsa güzel olur kodların saçma sapan çıkmasından bıktım bende bi kod ekliyorum tüm tasarım kayıyor
__________________ >> zeynelkoc.com |
| |||
| ben kodu buldum ama çalıştıramadım :A Kod: <?php
/*
Plugin Name: Plaintext
Plugin URI: http://www.thunderguy.com/semicolon/wordpress/plaintext-wordpress-plugin/
Description: Allow visitors to view any file (even PHP or HTML files) as plain text simply by placing the file inside a "plaintext" directory. After activating or deactivating, go to the <a href="options-permalink.php">Permalinks</a> page to complete the process.
Version: 1.4
Author: Bennett McElwee
Author URI: http://www.thunderguy.com/semicolon/
$Revision$
INSTRUCTIONS
1. Copy this file into your plugins directory.
2. Log in to WordPress administration. Go to the Plugins page and Activate this plugin.
3. In WordPress administration, go to Options and click Permalinks.
4. Create a directory called "plaintext" in your wp-contents directory.
Place files within the plaintext directory. These files will be accessible in a virtual plaintext directory in your blog. For example, if you have a PHP file in /blog/example.php, then anybody who views it will see the output from the PHP script. However, if you put the file in /blog/wp-content/plaintext/example.php, then anybody who views the file through the URL /blog/plaintext/example.php will see the source code for the PHP script.
Use this plugin for distributing your source soce to an admiring world.
Copyright (C) 2005 Bennett McElwee (bennett at thunderguy dotcom)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
The license is also available at http://www.gnu.org/copyleft/gpl.html
*/
// Configuration
$tguy_pt_base = 'plaintext';
// If this file is called directly, display the requested file
if (!defined('ABSPATH')) {
// WordPress is not loaded.
// This file is probably being called to display a file as plain text.
error_reporting(E_ALL ^ E_NOTICE);
if ($_GET['plaintextpath'] != '') {
// We're required to serve a file. If the file exists and is
// within the plaintext directory and exists, then serve it as
// plain text.
$plaintext_root = dirname(dirname(__FILE__)) . "/$tguy_pt_base/";
$file_path = $plaintext_root . $_GET['plaintextpath'];
$plaintext_root = realpath(strtr($plaintext_root, '\\', '/'));
$file_path = realpath(strtr($file_path, '\\', '/'));
if (file_exists($file_path)
&& 0 == strncmp($file_path, $plaintext_root, strlen($plaintext_root))) {
header('Content-type: text/plain');
readfile($file_path);
} else {
// Either the file does not exist, or it's not in the plaintext
// directory. This should never happen unless somebody accesses
// this script directly, in which case they deserve nothing more
// than this minimal message.
header("HTTP/1.0 404 Not Found");
header('Content-type: text/plain');
echo 'The file does not exist.';
}
exit;
}
}
// Internal machinery
function &tguy_pt_rewrite_rules(&$rules_string) {
/* Add a new rule to the given string so as to enable plaintext URLs.
This rule must come before the default WordPress "catch-all" rule.
If a request is for a file in blog-home/plaintext, and if the
corresponding file exists in blog-root/wp-content/plaintext, then
the request is mapped internally to a request for plaintext.php
(this file), with the path of the original file as a query argument.
*/
global $tguy_pt_base;
$site_root = parse_url(get_settings('siteurl'));
$site_root = trailingslashit($site_root['path']);
// Rewrite "/blog/plaintext/source/file.php"
// as "/blog/wp-content/plugins/plaintext.php?plaintextpath=source/file.php"
$rules_string =
"# Begin Plaintext WordPress plugin
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase {$site_root}
RewriteCond %{DOCUMENT_ROOT}{$site_root}wp-content/{$tguy_pt_base}/$1 -f
RewriteRule ^$tguy_pt_base/(.+)$ {$site_root}wp-content/plugins/plaintext.php?plaintextpath=\$1 [L]
</IfModule>
# End Plaintext WordPress plugin
" . $rules_string;
return $rules_string;
}
// Enable plaintext URLs
if (function_exists('add_filter')) {
add_filter('mod_rewrite_rules', 'tguy_pt_rewrite_rules');
}
?>
__________________ $ |
| |||
| Alıntı:
__________________ $ |
| |||
| |
| ||||
| repgöz insanlar ya
__________________ >> zeynelkoc.com |
![]() |
| Konuyu Toplam 1 Üye okuyor. (0 Kayıtlı üye ve 1 Misafir) | |
| Seçenekler | |
| Stil | |
| |
Benzer Konular | ||||
| Konu | Konuyu Başlatan | Forum | Cevaplar | Son Mesaj |
| 3 lü Banner Reklam Alanı | oyuncul | MyBB | 0 | 13-09-2007 22:37:21 |
| Pop-up alanı boş olanlar ..... Bakınız .... | Pembekedi | Reklam Alım Satım | 2 | 25-06-2007 13:07:04 |
| New Profil alanı & İmza :) | Metallica | SMF | 3 | 28-05-2007 18:32:28 |