Guide to topic Extraction for phpbb3

Guide to topic Extraction for phpbb3

Indlægaf Jonni Laumann » fre sep 24, 2010 1:26 pm

Guide to topic Extraction for phpbb3 "3.0.4" My first post...her goes!

1.Download and copy the 4 files (topic_bottom.php , topic_config.php , topic_look.php , topic_top.php) to your forum directory (usually: "http://www.my_site_name.com/phpbb3/" ) .Its the folder where you installed the forum. (use ftp if your site is on remote server).

note: if your forum is installed in ex: "http://www.my_website.com/forum/" you have to change "phpbb3" to "forum" in the next steps.

2.Place following line before all other code on any of your html website (before: <!DOCTYPE....)
<?php include('./phpbb3/topic_top.php'); ?>

3. Place following line anywhere in <body> . Must be the same website as above.
<?php include('./phpbb3/topic_bottom.php'); ?>

4.Rename the website you just included the 2 lines...to ".php" extension instead of your .html
(now you proberly have to correct some url in your website when renaming one of your .html sites to .php)

5. Open the file: "topic_config.php"...my config below:

$forum = '43,73';
// This is the forum ID where you wish to take Topics from.This can be a number, a few numbers seperated by commas or the word 'all' to use all forums.
// The number 43 in this ex is from "http;://www.my_site_name.com/phpbb3/viewforum.php?f=43"

$limit = '5';
// The number of topics to extract from forum and display. Must be a number!

$title_char = '20';
//The character cut-off for the topic title.So if you topic title hits say 70 characters it will but cut off by "...", useful for small width websites.

$post_char = '40';
// The character cut-off for the postSo if you post hits say 500 characters it will but cut off by "...", useful for small width websites.

$show = '';
// How to show the topics on your website.
Setting to 'full' will show the full topic (title, post, date etc).
Setting to '' will just show the topic title.

$date_time = 'short';
// How to display the date. "short" or "long"

$topic_link_type = 'phpbb';
//How clicking the topic title works.
//Setting to 'topic' will use Topic Extraction to view the topic on your website,
//Setting to 'phpbb' will send you to the actual phpbb3 topic on your forum.

$comment = 'topic';
// How to use the comment link. (Only used when $show is set to full)
//Setting to 'topic' when clicked will send them to the topic itself,
//Setting to 'reply' will send them to a direct reply box.

$phpbb_root_path = './phpbb3/';
// Where your phpbb3 installation is located.
//For example './phpbb3/' or './forum/' or './messageboard/'
// dont include http://www.my_site_name.com anywhere
// if forum installed in http://www.my_site_name.com/phpbb3/ its './phpbb3/'

$phpbb_folder = '/phpbb3/';
// Where your phpbb3 installation is located.usually same as root_path above
// For example './phpbb3/' or './forum/' or './messageboard/'

$smilies_path = "{$phpbb_root_path}images/smilies";

6.Thats it!.Does it work?.. if not: maybe you have to change forum directory, or change structure so your html websites is in root folder.


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

Wuhuu finally :lol: .Solved how to extract different topics from forum and place them different places on same webpage. Here is a solution that worked for me in phpbb3.0.4 using [ALPHA] Topic Extract 0.2.3

Demo: http://www.parafun.dk

1. Implement a working " [ALPHA] Topic Extract 0.2.3" first before you continue.

2.Open: "topic_config.php" and add new lines with new names for forum and limit. Names dosent matter i just called it "forum2" and the limit: "limit2", I did this so i know that those with number 2 in name are connected .

$forum = '43'; // this is orig line, in this example only one forum to extract from
$forum2 = '73'; // this is the new line you add, name it anything just remember to change in the topic2_bottom.php file we make later on.

$limit = '3'; // this is orig line
$limit2 = '4'; // this is the new line you add, name it anything just remember to change in topic2_bottom

3a..Dublicate your "topic_bottom.php".
3b..Rename to ex "topic2_bottom.php" and open the new file.In My ex: "topic2_bottom.php"
Note: the name "topic2_bottom.php" must be same as named in part 6.
3c..Search for "$topics" and replace with "$topics2" (or what ever you like to call it)
note..there are 15 lines with "$topics" to replace in "topic2_bottom.php", and only change "$topics" not lines with only "topic"
3d..Search in topic2_bottom.php for: "$forum" and replace with "$forum2" (or what ever you called it in toppic_config)
3e..Search in topic2_bottom.php for "$limit" and replace with "$limit2" (or what ever you called it in toppic_config)
3f.. Find in "topic2_bottom.php" :
include('topic_look.' . $phpEx);
replace with
include('topic2_look.' . $phpEx);

4a.. Dublicate your "topic_look.php".
4b. Rename to "topic2_look.php" (same name as in 3f)and open the file.
4c..Search for: $topics and replace with: $topics2 (or what ever you called it in "3c")

5. Upload your 2 new files "topic2_look.php" and "topic2_bottom.php" to your server where you alrady have the 4 files topic_look, topic_bottom,topic_top. topic_config.6 toppic files are now in your forum folder.

6.include a simular line as the following for showing the new extra extraction from forum. Place it anywhere in your websites <body>:
<?php include('./phpbb3/topic2_bottom.php'); ?>

...note: I just called it "topic2_bottom.php" (the number 2 again reminding me what to look for in "topic_config"). You can name it anything just remember to change to the same in 3a+3b and remember to change "phpbb3" above to your folder name, if your forum is installed in another folder.

..... :mrgreen: ....thats it!..

Note: further tweak is to add a line in "toppic_config.php":
1.
$show = ' '; // this is orig line, this extraction only shows the title from forum topic
$show2 = ' full'; // new added line to have comments below title in second extraction
..then find "$show" in "toppic2_bottom.php" and rename to "$show2"

2.
-Dublicate, rename and upload multiple "toppic_bottom.php" and "toppic_look.php"...etc like above
Exampel:
-where forum installed at http://www.my_site_name.com/phpbb3/
-and following code for website placed in root(http://www.my_site_name.com/xxxxx.php):

<?php include('./phpbb3/topic_top.php'); ?>
<!DOCTYPE..................................etc
<body>
from forum 1<br />
<?php include('./phpbb3/topic_bottom.php'); ?>
<br />
from forum 2<br />
<?php include('./phpbb3/topic2_bottom.php'); ?>
<br />
from forum 3<br />
<?php include('./phpbb3/topic3_bottom.php'); ?>
.....etc

PS..As always I only use "notepad ++" to change code for html,php etc.
DONT! use windows notepad or wordpad, in different browsers they will screwup many things like BOM,UTF-8..etc. .Trust me or see:http://blogs.msdn.com/oldnewthing/archive/2007/04/17/2158334.aspx
..other tip is not to use html code target _blank" or other php code for linkin to new tab/window. Different browsers behave differntly on the code and the user can just right-click and open in new tab/window in all browsers.I once wanted this on my site (users wish is law), but this is a NO NO in coding. So i try to convince users(newbies) to rightclick or just hit back after readingin/visiting forum

To author..how about moving forward to [beta]........ :shock:
Jonni Laumann
Webmaster
 
Indlæg: 177
Tilmeldt: tors okt 30, 2008 1:18 pm

Tilbage til phpBB MOD

Hvem er online

Brugere der læser dette forum: Ingen tilmeldte brugere

cron