vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How to use vbuletin wysiwyg in a parent directory of the forum one (https://vborg.vbsupport.ru/showthread.php?t=75544)

Akex 02-01-2005 11:16 AM

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.

noppid 02-01-2005 03:44 PM

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.

Akex 02-01-2005 05:18 PM

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.

noppid 02-01-2005 07:04 PM

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.

Akex 02-01-2005 07:30 PM

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') . '");');
}


?>


Akex 02-07-2005 12:50 PM

Nobody can help :( ?

Thanks :)

noppid 02-07-2005 05:40 PM

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

BTW, you are only handling Enhanced mode text.

Akex 02-07-2005 07:25 PM

Well, I said : with this script it works when in the forum directory but not in the parent.


All times are GMT. The time now is 07:10 AM.

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.01568 seconds
  • Memory Usage 1,741KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete