• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Wordpress Widget, last x xenForo Topics to WordPress widget area(s).

Jethro

Well-known member
Requirement, Wordpress 3.0.x, xenForo (else it will look really silly), an ftp tool.

What it does: Basically via your WP Dashboard you can select how many topic titles to display in a block on your Wordpress Blog. The widget provides a link to the actual individual topics.

New version posted 24 Jan 2011

Changes

- Some minor things fixed up
- Ability to exclude Private forums from the Settings option in the WP Dashboard, thanks Rob and Mike for explaining how the db hangs together.
- gotski additional topic title manipulation added.
- Full install instructions now included in the zip.


Example www.xenique.com
 

Attachments

Code:
Warning: include(./forum/library/config.php) [function.include]: failed to open stream: No such file or directory in /home/content/99/7000799/html/wp/wp-content/plugins/xenLastPosts/xenlastposts.php on line 85

Warning: include() [function.include]: Failed opening './forum/library/config.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/content/99/7000799/html/wp/wp-content/plugins/xenLastPosts/xenlastposts.php on line 85

Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/99/7000799/html/wp/wp-content/plugins/xenLastPosts/xenlastposts.php on line 94
MySQL Connect :

This is what I am getting.

See here http://myfoxhunter.com/
 
Would be nice to be able to call it directly on custom page template instead of using widget.
How much load will this add to wp pages and post?
 
Code:
Warning: include(./forum/library/config.php) [function.include]: failed to open stream: No such file or directory in /home/content/99/7000799/html/wp/wp-content/plugins/xenLastPosts/xenlastposts.php on line 85

Warning: include() [function.include]: Failed opening './forum/library/config.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/content/99/7000799/html/wp/wp-content/plugins/xenLastPosts/xenlastposts.php on line 85

Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/99/7000799/html/wp/wp-content/plugins/xenLastPosts/xenlastposts.php on line 94
MySQL Connect :

This is what I am getting.

See here http://myfoxhunter.com/

Rob in the settings option what have you entered for the Xen Directory? Looks to me like you might have to enter "./forum/" the dot before the forward slash may fix your problem.
 
Would be nice to be able to call it directly on custom page template instead of using widget.
How much load will this add to wp pages and post?

Zero load to a Xen post as the widget operates outside of xenForo.

Sorry developed this one as a direct requirement for something we were working on and thought I might share it with the general community.
 
Can you add an option to set custom title in the widgets section? Because now wordpress doesn't recognise widget title so we don't get any styling.
 
Can you add an option to set custom title in the widgets section? Because now wordpress doesn't recognise widget title so we don't get any styling.


Hi there, the widget-title is a standard class of the twentyten theme, if you are using another theme you will have to add the CSS yourself.

Code:
.widget-title {
    color: #222;
    font-weight: bold;
}

Here is an example of it working on the base Twentyten theme....

http://www.xenique.com/
 
Jethro, big thx for your WP mod. I have problem with my urls if title thread includes '. And I've added
$url_title = str_replace('!', '', $url_title);
$url_title = str_replace('\'', '', $url_title);
 
How do you alter css/look of the widget?


Your theme doesn't use the standard Twenty Ten theme classes, it uses slightly different ones.. you can do two different things to make them the same.

1. Change the Classes in Jeff's Mod to those in your theme...

Open up your WP ACP and click on plug ins - Xenforo Latest Topics- and click on the "edit" button to open the PHP file.

In there you will find a section that has the HTML output, you can carefully change the classes to the relevant classes of your theme.

Your theme author has used the following classes instead..

widget_title
widget_recent_comments

So they would look like this...

Code:
    echo '<li id="archives" class="widget widget_recent_comments">';
    echo '<h3 class="widget_title">'.$xentitle.'</h3>';

Then save.

This should work, however I can't test it of course, so it will be TRIAL AND ERROR - make sure you take a backup of the PHP file before you begin.

--------------------

There is another method you could try...

2. Create the CSS classes used in Jeff's mod..

Open up your WP theme's style.css file, and find the class for the widget header.

widget_title

Copy and paste underneath in the same CSS sheet.

Rename the copied version to widget-title

h2.widget_title ----------------- becomes---------------------- widget-title (note hyphen not underscore)

and

Then create

widget-container

using the same details as the others in the column...

Code:
.widget-container ul li {
	line-height:18px;
	color:#666;
	width:auto;
	border-bottom:1px dotted #D3D9EB;
	margin-left:3px;
	list-style:none;
	padding:2px 0 2px 10px;
	display:block;
	background:url(red/ico_widget_li.gif) no-repeat left 7px;
}

You can also just piggy back the new classes into the old...

so..



Code:
.widget ul li,
.widget-container ul li {
    line-height:18px;
    color:#666;
    width:auto;
    border-bottom:1px dotted #D3D9EB;
    margin-left:3px;
    list-style:none;
    padding:2px 0 2px 10px;
    display:block;
    background:url(red/ico_widget_li.gif) no-repeat left 7px;
}

h2.widget_title,
h3.widget-title {
	text-transform:uppercase;
	color:#cd1713;
	font-size:23px;
	margin:4px 0;
	letter-spacing:-1px;
}

Whilst not perfectly elegant, any of the above should work to give you the same as the other widget boxes in your existing theme.
 
Should have a new version up later today or early tomorrow that incorporates excluding Private forums, thanks Mike, and gotski's additional title fixes :) Just finishing off the CSS for the documentation, oh yes there will be pictures kids
 
Updated with latest release, see first post in thread.

If previously installed, then simply de-activate the widget and delete. Re-install via the included readme.html file.
 
Top Bottom