Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-01-2005, 11:16 AM
Akex Akex is offline
 
Join Date: Jul 2003
Location: France
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to use vbuletin wysiwyg in a parent directory of the forum one

Hi,

Well, i'll try to explain my problem.

I'm trying to make a php script whch allows the use of the wysiwyg editor in a parent directory of the forum one.

So Everything loads ok, I have something similar to the code given in this thread

https://vborg.vbsupport.ru/showthread.php?t=66895


In order to make the editor work, I did a str_replace (or eregi_replace) for the $messagearea var, to replace relative urls (clientscript/... and images/...) into real urls ($vboptions[bburl]/...).

Now, in the source code of the html page generated the urls of called javascripts and images are fine (the editor loads with pitures ... ).

The probleme : it's for me impossible to write any message (impossible to have the cursor in the message area) and impossible to click the B, I, U ... buttons.


So, how to make it work ? (without copying the clientscript directory in the root folder ).

Thank you for any help.
Reply With Quote
  #2  
Old 02-01-2005, 03:44 PM
noppid noppid is offline
 
Join Date: Mar 2003
Location: Florida
Posts: 1,875
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hehe, I just took the time to learn this last night.

Assuming you can handle your paths to the JS...

1) check your body tag
2) check your form tag
3) check for define('GET_EDIT_TEMPLATES',
4) check your $phrasegroups = array(
5) check your $specialtemplates = array(
6) Check your requires, there are several needed.

For the proper configuration to get those controls going.

Look at the code for editing a signature, good clean easy example.
Reply With Quote
  #3  
Old 02-01-2005, 05:18 PM
Akex Akex is offline
 
Join Date: Jul 2003
Location: France
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by noppid
1) check your body tag - $onload
2) check your form tag - ok
3) check for define('GET_EDIT_TEMPLATES', - true
4) check your $phrasegroups = array( - ok
5) check your $specialtemplates = array( - ok
6) Check your requires, there are several needed. -ok
Everything is ok, as the page works when in the forum directory but not when in the parent directory.
Reply With Quote
  #4  
Old 02-01-2005, 07:04 PM
noppid noppid is offline
 
Join Date: Mar 2003
Location: Florida
Posts: 1,875
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There are solutions, but not knowing what your code is on the php page in use, I'm not sure how to implement a fix or suggestion.
Reply With Quote
  #5  
Old 02-01-2005, 07:30 PM
Akex Akex is offline
 
Join Date: Jul 2003
Location: France
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here is the code with comments for filed in address http://www.yoursite.com/dir1/dir2/ and forum called this way : http://www.yoursite.com/forum/


PHP Code:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
define('GET_EDIT_TEMPLATES'true);

//specialtemplates are called in another file as this one is called in require_once
//ie :     'smiliecache' and 'bbcodecache',



// ######################### REQUIRE BACK-END ############################
//file in root/dir1/dir2/ and forum files in root/forum/
chdir('./../../');
require_once(
'./dir.php'); //contains path information
if (forum) {
chdir(forum);
}
require_once(
'./global.php');
require_once(
'./includes/functions_newpost.php');
require_once(
'./includes/functions_editor.php');


    
$textareacols fetch_textarea_width();

    
construct_edit_toolbar($newpage['message'], 000);

    
$subject $newpage['title'];

//replace js call
    
$messagearea=eregi_replace("href=\"clientscript","href=\"" $vboptions['bburl'] . "/clientscript",$messagearea);
//replace pictures call
    
$messagearea=eregi_replace("src=\"([^(http)])([^>]*)","src=\"" $vboptions['bburl'] . "/\\1\\2",$messagearea);

    eval(
'print_output("' fetch_template('template') . '");');
}


?>
Reply With Quote
  #6  
Old 02-07-2005, 12:50 PM
Akex Akex is offline
 
Join Date: Jul 2003
Location: France
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nobody can help ?

Thanks
Reply With Quote
  #7  
Old 02-07-2005, 05:40 PM
noppid noppid is offline
 
Join Date: Mar 2003
Location: Florida
Posts: 1,875
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not sure what to tell ya, but something is missing. Posting Phrases seem missing?

BTW, you are only handling Enhanced mode text.
Reply With Quote
  #8  
Old 02-07-2005, 07:25 PM
Akex Akex is offline
 
Join Date: Jul 2003
Location: France
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, I said : with this script it works when in the forum directory but not in the parent.
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 01:33 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04662 seconds
  • Memory Usage 2,245KB
  • 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
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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