NC@WP
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Putting an ad under just the FIRST post?Your theme has something like this in its index file:
<?php while (have_posts()) : the_post(); ?> <div class="post"> <!-- post-level stuff here --> </div> <?php endwhile; ?>
In WordPress lingo, it’s called The Loop. What you need is to modify it along these lines:
<?php // This part is responsible for retrieving information // about the current user and can be placed anywhere // before The Loop: global $user_ID; get_currentuserinfo(); ?> <?php while (have_posts()) : the_post(); ?> <div class="post"> <!-- post-level stuff here --> <?php if ('' == $user_ID) { // user not logged in if (!is_defined('AD_SHOWN')) { // show ad define('AD_SHOWN', true); } } ?> </div> <?php endwhile; ?>
Forum: Themes and Templates
In reply to: Adding WordPress To A Website TemplateYou can definitely use the template as a starting point for developing a theme. But to complete the development, you need to understand quite a few things about HTML, CSS, and PHP programming (both in general and as it pertains to WordPress).
Forum: Fixing WordPress
In reply to: How to Add YouTube VideosNot a clue… There’s a great plugin called Embedded Video, but last I checked it doesn’t work with 2.5…
Forum: Themes and Templates
In reply to: List of WordPress themesIt never was at www.ads-software.com, it’s always been (and still is) at themes.wordpress.net…
Forum: Plugins
In reply to: does WordPress have a Forum ExtNo, but is does have a sister product called bbPress, which can be seamlessly integrated with it.
Forum: Themes and Templates
In reply to: Adding WordPress To A Website TemplateYou’re going about it in reverse… You can’t “add WordPress to a template”; you need to adapt the template into a theme usable by WordPress (or install and enable a ready-made theme, of which there are literally thousands).
Forum: Fixing WordPress
In reply to: Importing variables e.g. Price into loads of postsWhat you wrote won’t work as a plugin, simply because your function has no argument (and because you’re using the wrong hook). Here’s a rough (but tested) alternative draft:
<?php /* Plugin Name: Show Price Plugin URI: https://www.ads-software.com/support Description: Displays product price based on product ID. Version: 0.1 Author: NC(at)WP Author URI: https://www.ads-software.com/support Usage: [showPrice: ID] */ function showPrice_install() { return true; } function showPrice_display($content = '') { ob_start(); $currencySymbol = '&_#36;'; // U.S. dollar; replace if necessary $prices = array( 1 => 5, 2 => 6, 3 => 7 ); $matches = array(); $match = preg_match_all('/\[showPrice:(.*)\]/Ui', $content, $matches); foreach ($matches[1] as $k => $match) { $match = (int) trim($match); if (isset($prices[$match])) { $price = $currencySymbol . number_format($prices[$match], 2); } else { $price = 'N/A'; } $content = str_replace($matches[0][$k], $price, $content); } ob_end_clean(); return $content; } // Plugin core if (isset($_GET['activate']) && $_GET['activate'] == 'true') { add_action('init', 'showPrice_install'); } add_filter('the_content', 'showPrice_display'); ?>
What you can do now is rewrite the population of the
$prices
array inside theshowPrice_display()
function, so that the array is populated from a CSV file or a database…Be sure to remove the underscore from the
$currencySymbol
assignment; I put it in just to show that it is an HTML entity rather than the actual dollar sign…Forum: Fixing WordPress
In reply to: Importing variables e.g. Price into loads of postsSounds like you need to write a custom plugin… In your post, you would type something like [showPrice: 1234]; the plugin would replace this with the current price of item number 1234.
Forum: Themes and Templates
In reply to: Wondering if was possible (PSD to WordPress)Of course it’s possible. But you (or whoever else takes this up) need to be well-versed in HTML, CSS, PHP in general, and PHP as it pertains to developing WordPress themes in particular.
There is a lot of information about theme development in the Codex, so you should check it out…
Forum: Fixing WordPress
In reply to: Create a newsletter templateWhat sort of newsletter are we talking about? Is it something you want to publish on the Web site or is it something that’s supposed to go out in an e-mail?
Forum: Installing WordPress
In reply to: NO CLUE what I’m doingAdmin panel is located in the
/wp-admin
subdirectory. So if your blog was set up at yoursite.com, the admin panel will be at yoursite.com/wp-admin. If your blog was setup at yoursite.com/blog, the admin panel will be at yoursite.com/blog/wp-admin.Forum: Plugins
In reply to: Last Post on main Site Index Page ?Yes. You just need to query the
wp_posts
table in the WordPress database. Note, however, thatwp_
is the default prefix that could have been set to something else during installation, so your database might have a different table name.Forum: Fixing WordPress
In reply to: Inserting table in post from MySQL DBYou need to write a plug-in for that… See the Plugin API documentation.
Forum: Installing WordPress
In reply to: Using WordPress and Blog on local drives (file system)It is already open, unless your firewall blocks it. Just have your colleagues type
https://yourcomputername/
(whereyourcomputername
is your computer’s network name) into their Web browsers. They can also use your computer’s IP address, for example,https://192.168.1.123/
Forum: Plugins
In reply to: share userlist between WP and phpBB?December 2007 is in fact ancient. Read the most recent post on wp-united.com, it clearly says, Updated to work with phpBB3 RC8 & WordPress 2.3.1. Since then, phpBB 3 went into production and actually had a minor upgrade (so the current version is 3.0.1) and, more importantly, WordPress 2.5 came out, containing major modifications to user management, including the new password storage using the phpass library.
Nevertheless, if you’re inclined to try it out, let us know how it went.