Firas
Forum Replies Created
-
there’s an ABSPATH constant. eg. <?php echo ABSPATH ?>
Forum: Plugins
In reply to: simple: Browser detection?Ok, I think I have this.
Replace the index.php in your wordpress root with this:
<?php
if(empty($_COOKIE['ThemeSwitched'])) {
if (eregi("MSIE",getenv("HTTP_USER_AGENT")) || eregi("Internet Explorer",getenv("HTTP_USER_AGENT"))) {
setcookie('ThemeSwitched', 'true');
header('Location: /?wptheme=WordPress+Classic');
} else {
setcookie('ThemeSwitched', 'true');
header('Location: /?wptheme=WordPress+Default');
}
}define('WP_USE_THEMES', true);
require('./wp-blog-header.php');
?>If your WordPress install is not accessible from your site root, then replace the two
header('Location: /?wptheme=
withheader('Location: https://example/?wptheme=
, example being the path you put in your browser to access your blog (eg.https://example.com/blog
).Replace
wptheme=WordPress+Classic
andwptheme=WordPress+Default
with the actual queries for the theme switcher for the themes you want to load. The first query is if the browser is IE, the second is if it’s not IE (so in the example code above, IE gets the Classic theme.)To see what query to send to the theme switcher, do a call to
<?php wp_theme_switcher(); ?>
somewhere in your template and see the URL it points to to load your preferred theme.Forum: Fixing WordPress
In reply to: Second Query Breaks Nav LinksIf you just want titles/links, try https://codex.www.ads-software.com/Template_Tags/get_posts
Forum: Fixing WordPress
In reply to: HELP! I’ve never seen this error before!heh, i should have waited a second ??
Forum: Fixing WordPress
In reply to: HELP! I’ve never seen this error before!Sounds like a temporary error with your host (temp folder filling up).
Forum: Plugins
In reply to: simple: Browser detection?mogwai, switching themes based on browser might be a bit complex–you’ll probably need to do it in the root/index.php so that you don’t see a flash of one theme and then see another–but it’s probably possible to send a query to the theme switcher plugin to do it.
Forum: Fixing WordPress
In reply to: inserting a php page in a “page”<?php include(ABSPATH . '/yourpage.php'); ?>
Forum: Fixing WordPress
In reply to: inserting a php page in a “page”You’ll need to make a custom page template or use runphp to put <?php include(ABSPATH ‘/yourpage.php’); >? in there.
Forum: Requests and Feedback
In reply to: full path disclosure: security problemAs for themes and plugins, you raise an interesting issue—it can’t be too hard to just lead wp include them and not execute upon a GET request by the browser.
Forum: Requests and Feedback
In reply to: full path disclosure: security problemDextro: no, we’ve heard of it… it’s just something that should be turned off in the PHP install. If your host lets you throw out errors to the browser, your host is doing you a disservice.
If you remain unretractable in your contention that a sysadmin issue just *has* to be taken care of by WordPress, please file a bug: https://trac.www.ads-software.com
Forum: Installing WordPress
In reply to: svn wordpress = how?Er… enclose that with <?php at the start and ?> at the end, save to a file with a .php extension, and run it to see what’s up.
Forum: Installing WordPress
In reply to: svn wordpress = how?/* Script has shell access */
$shell_exists = shell_exec('ls');if(empty($shell_exists)) {
echo "<p>Sorry, can't use shell_exec()</p>"; die();
} else {
echo "Can use shell_exec(), proceeding!";
}/* The SVN binary is available */
$svn_exists = shell_exec('which svn');if(empty($svn_exists)) {
echo "<p>Sorry, no SVN</p>"; die();
} else {
echo "<p>SVN available!</p>";
}Forum: Installing WordPress
In reply to: svn wordpress = how?You don’t need to diff anything, just update, which won’t mess with files you’ve changed. One thing: to be doing it remotely on your server they have to be SVN repositories to start with; you almost absolutely will need access to the shell or other ways of passing commands to it.
Forum: Plugins
In reply to: WP-ContactForm ProblemJinsan, I’m lost—for future reference, what part of this got the contact form working? ??
Forum: Plugins
In reply to: WP-ContactForm ProblemIn wp-contactform.php, there is a line saying:
add_filter(‘the_content’, ‘wpcf_callback’, 7);
Try increasing 7 to 10, or try making it 1, I’m not exactly sure what the problem is.