vBulletin SEO Forums

SEO

vBulletin Search Engine Optimization

Buy vBSEO Now! HACKER SAFE certified sites prevent over 99.9% of hacker crime.
ne nw
vBSEO Total Support Team Launches DeskPro New vBSEO Discount Level for Network Builders vBSEO 3.2.0 GOLD Has Landed Success with vBSEO = 600ore Web Visitors + $1400 in a Day! Crawlability Inc. Files for SEO Technology Patent
se sw

WordPress and global.php

This is a discussion on WordPress and global.php within the Off-Topic & Chit Chat forums, part of the Focus on Members category; Anyone have any experience with WordPress plugins? I'm trying like crazy to include the global.php file from vB into a ...

Go Back   vBulletin SEO Forums > Focus on Members > Off-Topic & Chit Chat

Enhancing 80 million pages.

Register FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read
  #1  
Old 07-25-2008, 04:28 PM
Citricguy's Avatar
Senior Member
 
Real Name: Josh
Join Date: Nov 2006
Location: Maui, Hawaii
Posts: 143
Blog Entries: 7
WordPress and global.php

Anyone have any experience with WordPress plugins? I'm trying like crazy to include the global.php file from vB into a plugin so I can do some conditional stuff within my posts but I always tend to get a fatal error any time i use require() or require_once()

I was hoping it would be as ease as:

PHP Code:
$vwd '/path/to/forums';
$cwd getcwd();
chdir($vwd);
//always fails out on the next line.
require_once('./global.php');
chdir($cwd); 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on Facebook!
Reply With Quote
  #2  
Old 07-25-2008, 04:49 PM
briansol's Avatar
Senior Member
vBSEO Pre-Release TeamDesign for SEOBig Board Administrator
 
Real Name: Brian
Join Date: Apr 2006
Location: Central CT, USA
Posts: 5,546
conditionals, like template conditionals?

including global.php into wordpress won't help you there.

wordpress has it's own template engine.


that said, are you sure you're in the right spot?

try

require_once('/public/forums/global.php');

with whatever your home directory path is
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on Facebook!
Reply With Quote
  #3  
Old 07-25-2008, 04:55 PM
Mert Gökçeimam's Avatar
vBSEO.com Webmaster
vBSEO Total Customer SupportvBulletin HackerBig Board Administrator
 
Real Name: Lizard King
Join Date: Oct 2005
Location: Istanbul
Posts: 7,817
Blog Entries: 1
Send a message via MSN to Mert Gökçeimam
Try

PHP Code:
$vwd '/your/forum/path';
if (
$vwd)
{
    
chdir($vwd);
}
require_once(
'./global.php'); 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on Facebook!
Reply With Quote
  #4  
Old 07-25-2008, 05:21 PM
Citricguy's Avatar
Senior Member
 
Real Name: Josh
Join Date: Nov 2006
Location: Maui, Hawaii
Posts: 143
Blog Entries: 7
I'm trying to consolidate everything into one plugin. If I include global.php into the wordpress config.php file, this plugin (well the bottom half atleast ) works as intended. But I cannot seem to get the global.php file to load from the plugin script itself.

They got the global.php file to load in another plugin over at Complete Wordpress/Vbulletin Bridge - Share Users And Postings - vBulletin.org Forum but it is bugged out pretty hard at the moment (due to WordPress updating to 2.6) and is why I wanted to just move the include code over. Otherwise I would just keep using their script with my stuff just appended to the end

I tried

PHP Code:
require_once('/public/forums/global.php'); 

and

PHP Code:
$vwd '/your/forum/path';
if (
$vwd)
{
    
chdir($vwd);
}
require_once(
'./global.php'); 


but both fail out when run as a wordpress plugin. When run as a standalone php file though they both work fine. I'm sure the path is correct now at least

Here's my problem code, followed by the full plugin.

I really appreciate you guys lookin at this. Now back to crawling the WP docs.
PHP Code:
// --- Problem Code Start ----//
//Get vB's global.php
$cwd getcwd();
$vwd '/path/to/forums';
chdir($vwd);
require_once(
'/absolute/path/to/forums/global.php');
chdir($cwd);
// --- Problem Code End----// 
And the (unfinished) full plugin for completeness...
PHP Code:
<?php
/* 
Plugin Name: *
Plugin URI: *
Description:  *
Plugin Version: *
Plugin Author: *
Author URI: *
 */ 

// --- Problem Code Start ----//
//Get vB's global.php
$cwd getcwd();
$vwd '/path/to/forums';
chdir($vwd);
require_once(
'/absolute/path/to/forums/global.php');
chdir($cwd);
// --- Problem Code End----//
 
//WordPress specific stuff
add_filter('the_content''hidden');

function 
hidden($content) { 
global 
$post;
global 
$vbulletin;
 
$out=$content

for (
$number=1;$number<=9;$number++)
            {
            
$key="HIDE".$number;
            
$htmlget_post_meta($post->ID$key,false);
            if (
$vbulletin->userinfo['usergroupid'] != 6) {
            
$html=$html[0];
            } else {
            
$html "<a href='http://".$_SERVER['SERVER_NAME'] . "/expert/external_login.php?r=http://"$_SERVER['SERVER_NAME'] .$_SERVER['REQUEST_URI'] . "&g=6'>TEST</a>";
            }
            
$find="[".$key."]";
            
$out=str_replace($find,$html$out); 
            }
    
return 
$out;
    }
?>
__________________
Blog | Stumble | LinkedIn
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on Facebook!
Reply With Quote
  #5  
Old 07-27-2008, 09:26 PM
Citricguy's Avatar
Senior Member
 
Real Name: Josh
Join Date: Nov 2006
Location: Maui, Hawaii
Posts: 143
Blog Entries: 7
I gave up on the plugin and just added the require() code to wp-config. lol, ill revisit it another day.

I did want to get your guys feedback though

3. Creating Your First Blog | Blogger Video Training contains my "members only" message. I can't wait to see what this does for my registrations!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on Facebook!
Reply With Quote
  #6  
Old 11-01-2008, 03:33 AM
Junior Member
 
Real Name: Jimmy scott
Join Date: Sep 2008
Posts: 2
Thanks for suggesting This plugin.

Last edited by Oleg Ignatiuk; 11-01-2008 at 09:42 AM. Reason: sig removed
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on Facebook!
Reply With Quote
Reply

Tags
global.php, wordpress

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
vb + vbSEo + Wordpress Ky! Deutsch 10 07-04-2008 10:56 AM
htaccess for vb and wordpress gdubs12345 URL Rewrite Settings 3 08-21-2007 07:55 PM
SEO Advice - Wordpress vol_freak General Discussion 1 05-04-2007 02:38 PM
Wordpress 301 Redirect Help Please BamaStangGuy General Discussion 7 12-13-2006 07:00 AM
Wordpress installed datarecall Troubleshooting 1 09-26-2006 07:46 PM


All times are GMT -4. The time now is 02:34 AM.


Powered by vBulletin Version 3.8.0 Beta 4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.5 ©2008, Crawlability, Inc.