Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-07-2001, 03:04 AM
petemay petemay is offline
 
Join Date: Dec 2001
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello,

Has anyone modified vB to insert HTM documents within a forum topic?

I would like to have a 'documentation' section on my web site with a table of documents for the user to chose from. I was planning on using a vB 'forum' page for the document index.

When a user selects a document (actually a vB topic) from the page, I would like the document to appear at the top of the page and then at the bottom a forum topic would be available for the user to post comments or questions about the document. I would like BOTH to appear on one page. I slapped something together with a Snitz forum that appears to work. I simply name the .htm file I want to include in the forum topic with the forum topic id. (i.e. 8.htm), then I have some code in the topic-display page that looks for that file in a directory and includes it.

The format is something like this:

Top of page:
------------------------------------
This document tells you everything you want to know about dirt.
1. dirt gets things dirty
2. dirt is tough to get out of your shirt.
3. I like dirt
------------------------------------
What do you think about dirt?:
<forum topic appears here>
-post1
-post2
-post3
------------------------------------
bottom of page

Can this type of thing be easily done with vB? I'm considering a purchase of vB to replace the Snitz forum.

Thanks,
PM
Reply With Quote
  #2  
Old 10-07-2001, 06:34 AM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If i understand you correctly, this isnt too hard, using PHPs output buffering functions inside the 'PHPinclude' template
Reply With Quote
  #3  
Old 10-18-2001, 03:53 AM
petemay petemay is offline
 
Join Date: Dec 2001
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Would you be able to provide some sample code that uses PHP's buffering functions? Are those types of functions already used somewhere in vBulletin? I am brand-spankin'-new to this php stuff. I'm not afraid to dig into it a bit - I'm just looking for some direction. Any manual pages you can point me to?

I'm trying to figure out the logic of the vBullitin processing. I see that the 'showthread.php' process is the one that displays the page, and the 'makenavbar' function apparently displays the top navigation bar. I would suspect that I would need to update the 'showthread.php' somewhere around there to insert the HTML from the other page....

Thanks for the response Merk! Now I need to find out why I didn't get an email from vBulletin when you updated my thread....
Reply With Quote
  #4  
Old 10-18-2001, 05:03 AM
petemay petemay is offline
 
Join Date: Dec 2001
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok,

I did some experimenting and have made some progress... but I just need a wee bit of help now:

I updated the showthread.php, and added the following to the bottom:


PHP Code:
// get htm file to include at the top of the thread:
ob_start();
require(
"../fielddoc/1/1.htm");
$fieldnote ob_get_contents();
ob_end_clean();

eval(
"dooutput(\"".gettemplate("showthread")."\");"); 
Then I updated the showthread template to include a reference to:

$fieldnote

just after the $header - this test works great!. however....

I would like the '.htm' file to be dynamic. The name of the .htm file should match the thread id.... so the 'require' command would need to be updated to reference the threadid variable. something like:

require("../fielddoc/1/" $threadid ".htm");

.. as I said I'm really wet behind the ears on this php stuff. What would the correct syntax for that command be? Any suggestions for an on-line guide to basic php?


Reply With Quote
  #5  
Old 10-20-2001, 11:41 AM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This isnt too hard, and i hope im not too late replying, been out of action for quite a while.

its simple>

PHP Code:

require("../fielddoc/1/".$threadid.".htm"); 
The . indicate basically a +.

That should solve your problem
Reply With Quote
  #6  
Old 10-25-2001, 04:06 PM
petemay petemay is offline
 
Join Date: Dec 2001
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Right on. That looks like it did it!

Thanks for the reply Merk!

Can you recommend any good php Tutorial web sites, so I can get myself up to speed on this stuff?

Thanks!
Reply With Quote
  #7  
Old 10-26-2001, 05:20 AM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by petemay
Right on. That looks like it did it!

Thanks for the reply Merk!

Can you recommend any good php Tutorial web sites, so I can get myself up to speed on this stuff?

Thanks!
Not really -

I dont really like the tutorial websites, and im more of a 'book' person.

I can recomend, 'Core PHP Programming Edition 2' It has a purple spine.

A very wonderful book.

Someone else may be able to help you with some tutorial websites however!
Reply With Quote
  #8  
Old 10-26-2001, 10:05 PM
Palmer ofShinra's Avatar
Palmer ofShinra Palmer ofShinra is offline
 
Join Date: Oct 2001
Location: Vancouver, BC, Canada
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="http://www.php.net/manual/en" target="_blank">http://www.php.net/manual/en</a>

The official PHP Manual online...

Not much of a tutorial, I'm afraid... but it's good when you need to learn the application of specific functions to do things.

I've used it a lot lately.
Reply With Quote
  #9  
Old 11-03-2001, 03:54 PM
feldon23's Avatar
feldon23 feldon23 is offline
 
Join Date: Oct 2001
Posts: 124
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Maybe I'm missing the point, but couldn't you just add questions to the FAQ? I know it would turn it into a "your FAQ" + "vB FAQ" but still...
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 10:09 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03931 seconds
  • Memory Usage 2,242KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete