How to Intrigate Wordpress with xbtit?

  • 20 Replies
  • 3852 Views
*

Offline bhorer_alo

  • ****
  • 397
  • +0/-0
  • I'm Back!
    • OtakuBT.com
How to Intrigate Wordpress with xbtit?
« on: January 08, 2012, 02:46:11 pm »
As the topic name says, please someone give me some idea.
I've seen a website who've successfully done that.
http://www.area51bd.com

Take a look into it.
I'm a novice, eager to learn.
otakubt.com

*

atmoner

Re: How to Intrigate Wordpress with xbtit?
« Reply #1 on: January 08, 2012, 03:07:08 pm »
yes, it's this plugin -> http://wordpress.org/extend/plugins/wp-trader/
or you can test my coding for export torrent xbtit to WP -> http://www.youtube.com/watch?v=kFBRqo7EORU

edit: I'll put my source code on github

*

atmoner

Re: How to Intrigate Wordpress with xbtit?
« Reply #2 on: January 08, 2012, 03:26:03 pm »

*

Offline bhorer_alo

  • ****
  • 397
  • +0/-0
  • I'm Back!
    • OtakuBT.com
Re: How to Intrigate Wordpress with xbtit?
« Reply #3 on: January 08, 2012, 05:10:08 pm »
Your plugin works just fine.
But how to intregate xbtit and smf user data also?
The website I did mention, use only the header and the menu from wordpress. And they were able to integrate the users too.

However, I was able to call the header of wordpress through some tests as discussed here:
http://wordpress.org/support/topic/integrating-wp-in-external-php-pages
and
http://codex.wordpress.org/Integrating_Wordpress_with_Your_Website

But I couldn't call the header of wordpress in xbtit.

Look at the example:
Code: [Select]
<?php
require('./../wp-load.php');
get_header();
$user_id 1;
$user get_userdata($user_id);
if (
$user) {
 echo 
'<p>' $user->first_name ' ' $user->last_name '</p>';
}
?>

<h1>This is a test</h1>

<?php get_sidebar(); ?>
<?php get_footer(); ?>

require('./../wp-load.php')
Is because I installed wordpress on the webserver root directory and put xbtit in a sub folder.
I'm a novice, eager to learn.
otakubt.com

*

Offline tarif0011

  • ****
  • 251
  • +0/-0
  • Bangladesh
    • Somopon.Net
Re: How to Intrigate Wordpress with xbtit?
« Reply #4 on: February 01, 2012, 01:54:15 am »
atmoner plz help
how to fixed this error

*

atmoner

Re: How to Intrigate Wordpress with xbtit?
« Reply #5 on: February 01, 2012, 02:05:52 am »
I do not code for Windows systems! ::)
but test to add you absolute path in this line:

Code: [Select]
include "class/BBCode.class.php";
so

Code: [Select]
include "c:\\your\path\class/BBCode.class.php";

*

Offline tarif0011

  • ****
  • 251
  • +0/-0
  • Bangladesh
    • Somopon.Net
Re: How to Intrigate Wordpress with xbtit?
« Reply #6 on: February 01, 2012, 05:30:33 am »
Thanks atmoner for your reply
plz help

Code: [Select]
include "c:\\your\path\class/BBCode.class.php";not working  :( :(

*

Offline Yupy

  • ****
  • 1,154
  • +0/-0
    • ...:::MidnightXpress:::...
Re: How to Intrigate Wordpress with xbtit?
« Reply #7 on: February 01, 2012, 05:42:37 am »
Try: include ("class/BBCode.class.php");

*

Offline tarif0011

  • ****
  • 251
  • +0/-0
  • Bangladesh
    • Somopon.Net
Re: How to Intrigate Wordpress with xbtit?
« Reply #8 on: February 02, 2012, 12:56:07 pm »
Thanks Bro for your reply
now error change show this error
Code: [Select]
Fatal error: Call to undefined method BBCode::parse() in C:\Program Files\xampp\htdocs\blog\wp-content\plugins\atmoner-Xbtit-export-to-Wordpress-2062a07\xbtit.class.php on line 53
plz help

*

Offline Yupy

  • ****
  • 1,154
  • +0/-0
    • ...:::MidnightXpress:::...
Re: How to Intrigate Wordpress with xbtit?
« Reply #9 on: February 02, 2012, 01:06:25 pm »
Post the line 53 from the file you getting that error...

*

Offline tarif0011

  • ****
  • 251
  • +0/-0
  • Bangladesh
    • Somopon.Net
Re: How to Intrigate Wordpress with xbtit?
« Reply #10 on: February 02, 2012, 01:31:38 pm »
line 53
Code: [Select]
$html_text = BBCode::parse($v['comment']);
full file
Code: [Select]
<?php

// Dev: Atmoner
// http://atmoner.com/

class Xbtit {
# internal variables

function getTorrents(){
$sql "SELECT torrents.info_hash,torrents.filename, torrents.data, torrents.comment FROM xbtit_files AS torrents "
$items mysql_query($sql) or wp_die__('pb database.') ); 
//Populate the array
while ($obj mysql_fetch_object($items)) {
// var_dump(get_object_vars($obj));
$array[$obj->info_hash]['info_hash'] = $obj->info_hash;
        $array[$obj->info_hash]['filename'] = $obj->filename;
        $array[$obj->info_hash]['data'] = $obj->data;
        $array[$obj->info_hash]['comment'] = $obj->comment;
        }
return $array;
}
###
function getCat(){
$sql "SELECT cat.id, cat.name FROM xbtit_categories AS cat "
$items mysql_query($sql) or wp_die__('pb database.') ); 
//Populate the array
while ($obj mysql_fetch_object($items)) {
// var_dump(get_object_vars($obj));
$array[$obj->id]['id'] = $obj->id;
$array[$obj->id]['name'] = $obj->name;
        }
return $array;
}
###
function getUsers(){
$sql "SELECT users.username FROM xbtit_users AS users "
$items mysql_query($sql) or wp_die__('pb database.') ); 
//Populate the array
while ($obj mysql_fetch_object($items)) {
// var_dump(get_object_vars($obj));
$array[$obj->users]['users'] = $obj->users
        } 
return $array;
}
 

###
function importTorrents(){
global $wpdb;
$wpdb->query("TRUNCATE TABLE $wpdb->posts");
$wpdb->query("TRUNCATE TABLE $wpdb->term_relationships");
foreach ($this->getTorrents() as $k => $v) { 
$html_text BBCode::parse($v['comment']);
$wpdb->insert
$wpdb->posts
array( 
'post_title' => $v['filename'],
'post_content' => $html_text,
'post_name' => strtolower($this->Replace($v['filename'])),
'post_date' => $v['data'],
'post_date_gmt' => $v['data']
)
);
 
}
}
###
function importCat(){
global $wpdb;
$wpdb->query("TRUNCATE TABLE $wpdb->terms"
);
foreach ($this->getCat() as $k => $v) {
$wpdb->insert
$wpdb->terms
array( 
'term_id' => $v['id'],
'name' => $v['name'],
'slug' => strtolower($this->Replace($v['name']))
)
);
$wpdb->insert
$wpdb->term_taxonomy
array( 
'term_id' => $v['id'],
'taxonomy' => 'category'
)
);
}
}
###
function Replace($t){
$search  = array(' ''.','/','%','_');
$replace = array('-','-','-','-','-');
$str str_replace($search$replace$t);
 
return $str;
}
###
function parseBbcode($t){
include ("class/BBCode.class.php");
$html_text BBCode::parse($t);
 
return $html_text;
}


}
###

?>

*

Offline Yupy

  • ****
  • 1,154
  • +0/-0
    • ...:::MidnightXpress:::...
Re: How to Intrigate Wordpress with xbtit?
« Reply #11 on: February 02, 2012, 02:19:35 pm »
Try this: $html_text = $BBCode->parse(($v['comment']);

If not working is posible to be a php issue what version of php you use?

*

Offline tarif0011

  • ****
  • 251
  • +0/-0
  • Bangladesh
    • Somopon.Net
Re: How to Intrigate Wordpress with xbtit?
« Reply #12 on: February 02, 2012, 03:05:55 pm »
Quote
Parse error: parse error, unexpected ';' in C:\Program Files\xampp\htdocs\blog\wp-content\plugins\atmoner-Xbtit-export-to-Wordpress-2062a07\xbtit.class.php on line 53

*

Offline Yupy

  • ****
  • 1,154
  • +0/-0
    • ...:::MidnightXpress:::...
Re: How to Intrigate Wordpress with xbtit?
« Reply #13 on: February 02, 2012, 03:29:14 pm »
Remove this: ;  from the line

*

Offline tarif0011

  • ****
  • 251
  • +0/-0
  • Bangladesh
    • Somopon.Net
Re: How to Intrigate Wordpress with xbtit?
« Reply #14 on: February 02, 2012, 03:50:23 pm »
Code: [Select]
Parse error: parse error, unexpected T_VARIABLE in C:\Program Files\xampp\htdocs\blog\wp-content\plugins\atmoner-Xbtit-export-to-Wordpress-2062a07\xbtit.class.php on line 54
now show this
« Last Edit: February 02, 2012, 03:55:58 pm by tarif0011 »

 


Powered by EzPortal