Forum Replies Created

Viewing 11 replies - 1 through 11 (of 11 total)
  • I am still having trouble finding out how to use a title in the dropdown box like “Select a page” as the documentation doesn’t cover this.

    Ditto on that. Anyone? =)

    Forum: Your WordPress
    In reply to: CivLegacy.com
    Thread Starter cogo

    (@cogo)

    Thanks for the feedback, appreciate it.

    The big emtpy square you’re talking about was just the google adbot being a bit lazy filling out the blanks so to speak.. With adblock on the empty space should be vanquished.

    cogo

    (@cogo)

    Just follow the instructions I posted. I don’t know what else to say since I’m not that clever with PHP. Sorry. Are you sure you have added all the necessary db settings?

    cogo

    (@cogo)

    No prob.

    hellows, are you sure you have added the code snippet into an actual template file (header.php, sidebar.php or any of your choice) instead of just inserting it into a post?

    There’s a no longer supported plugin by Brandon Alexander that I did some modifications to so that it works in phphBB3.

    Create a folder named wp-phpbb-files in your plugins and put this in a file named wp-phpbb.php:

    <?php
    /*
    Plugin Name: WP-phpBB
    Plugin URI: http://yoda.gatewayy.net/
    Description: This plugin gives you the recent posts in your phpBB
    Version: .9
    Author: Brandon Alexander
    Author URI: http://yoda.gatewayy.net/
    */
    
    function show_posts($limit = 5)
    {
    global $wpdb;
    //Put your phpBB and wordpress database info here:
    $WPDB = ""; //WP db name
    $PHPBBDB = ""; //phpBB db name
    $USERS_TABLE = "phpbb_users"; //phpbb user table
    $TOPICS_TABLE = "phpbb_topics"; //phpbb topics table
    $POSTS_TABLE = "phpbb_posts"; //phpbb posts table
    $SITEURL = ""; //Forum URL with trailing /
    	//Do not edit beyond this point
    	$lastfpost = 0;
    	$top5=array(-1,-1,-1,-1,-1,-1,-1,-1,-1,-1);
    	$wpdb->select($PHPBBDB);
    	$test = 0;
    	$results = $wpdb->get_results("SELECT * FROM $POSTS_TABLE ORDER BY post_time DESC");
    
    	if ($results)
    	{
    		foreach ($results as $post)
    		{
    			$user = $wpdb->get_row("SELECT * FROM $USERS_TABLE WHERE user_id = $post->poster_id");
    			$forum = $wpdb->get_row("SELECT * FROM $TOPICS_TABLE WHERE forum_id = $post->forum_id");
    			$topic = $wpdb->get_row("SELECT * FROM $TOPICS_TABLE WHERE topic_id = $post->topic_id");
    			$test = 0;
    			for($i=0;$i<=$limit;$i++){
    			if($topic->topic_id==$top5[$i]){ $test=1; }
    			}
    			if($user && $topic && $test==0)
    			{
    				$top5[$lastfpost]=$topic->topic_id;
    				$lastfpost += 1;
    				echo "<li><a href='" . $SITEURL . "/viewtopic.php?f=$post->forum_id&t=$post->topic_id'>";
    				$nposts=$topic->topic_replies+1;
    				echo "$topic->topic_title\n";
    				echo "</a>\n";
    				echo " at " . date("F j, Y - H:i", $post->post_time) . " \n";
    				echo "($nposts)</li>\n";
    				if($lastfpost == $limit){ break; }
    			}
    		}
    	}
    
    	$wpdb->select($WPDB);
    }
    
    ?>

    Don’t forget to edit in your correct db info and url.

    Activate the plugin and then put this where you want it to show:

    <?php show_posts("5"); ?>

    Change the number here and in the plugin to control the number of posts.

    You can see it live here: http://www.sporeev.com/

    If anyone would feel like further enhancing this plugin I’d be thrilled. It would be cool to be able to exclude certain forums for example.

    Thread Starter cogo

    (@cogo)

    Thanks mate!

    Thread Starter cogo

    (@cogo)

    Solved it: http://codex.ww.wp.xz.cn/Template_Tags/the_date

    The special note took care of it. Too bad though since my WP-RelativeDate plugin doesn’t seem to handle the_time. Oh well.

    Very efficient and straightforward design. Good job!

    Thread Starter cogo

    (@cogo)

    Looks logical. My php editing skills are a bit limited however. Here’s the code I’m using now together with where I want the next five to appear:

    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <div class="date">
    <span style="font-size: 20px; line-height: 95%;"><?php the_time('d')?></span><br />
    <span style="font-size: 20px; font-weight: bold; line-height: 62%;"><?php the_time('m')?></span><br />
    <?php the_time('Y')?>
    </div>
    <div class="post" id="post-<?php the_ID(); ?>">
    <ul>
    <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Read <?php the_title(); ?>"><?php the_title(); ?></a><br /><span class="post-flings">Categories: <?php the_category(', ') ?> | Comments: <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></span></li>
    </ul>
    </div>
    <?php endwhile; ?>
    <div class="navigation">
    <?php next_posts_link('<div class="alignleft">Previous Entries</div>') ?>
    <?php previous_posts_link('<div class="alignright">Next Entries</div>') ?>
    </div>
    <div style="clear: both; padding-top: 23px;">
    >>>NEXT FIVE HERE<<<
    </div>
    <p />
    <?php else : ?>
    <h2 class="center">Not Found</h2>
    <p class="center">Sorry, but you are looking for something that isn't here.</p>
    <?php include (TEMPLATEPATH . "/searchform.php"); ?>
    <?php endif; ?>

    Forum: Your WordPress
    In reply to: Spore EVolve
    Thread Starter cogo

    (@cogo)

    Thanks guys!

    I might do that. But I kinda like the default style. Especially how it looks in Opera. We’ll see.

    Thread Starter cogo

    (@cogo)

    I’m such an idiot! I seem to have solved it myself with some logical thinking. I just put the divs between the php.

    <div class="navigation">
    <?php next_posts_link('<div class="alignleft">Previous Entries</div>') ?>
    <?php previous_posts_link('<div class="alignright">Next Entries</div>') ?>
    </div>

    Maybe this can help someone in the future.

    Thanks for responses though guys, appreciate it! =)

Viewing 11 replies - 1 through 11 (of 11 total)