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 05-21-2006, 10:52 PM
whitejeep whitejeep is offline
 
Join Date: May 2006
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Does anyone know how to build a WYSIWYG EDITOR

Can some one point me to the documuntion to how to intergarte to WYSIWYG EDITOR in the to my vbulletin modifactions is it a function that i need to call if so what are the functions were can i find the correct documetion to find out how this can be done. Does anyone have any examples or ideas that how one goes about this. I would like to offer a wysiwyg editor to my web site and need to understand how to do that. THANKS
Reply With Quote
  #2  
Old 05-22-2006, 12:27 AM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

My userpage mod uses the vbulletin editor. It's not difficult to set up and use. userpage.php should give you an easy example of what to do.
Reply With Quote
  #3  
Old 05-22-2006, 05:30 AM
Logikos Logikos is offline
 
Join Date: Jan 2003
Posts: 2,924
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'll see about writing a tutorial up later tonight for you.
Reply With Quote
  #4  
Old 05-22-2006, 06:39 AM
Logikos Logikos is offline
 
Join Date: Jan 2003
Posts: 2,924
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Upload this file to your forums directory, and create a new template called testpage with the following contents.

HTML Code:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
        <!-- no cache headers -->
        <meta http-equiv="Pragma" content="no-cache" />
        <meta http-equiv="Expires" content="-1" />
        <meta http-equiv="Cache-Control" content="no-cache" />
        <!-- end no cache headers -->
        $headinclude
        <title><phrase 1="$vboptions[bbtitle]">$vbphrase[x_powered_by_vbulletin]</phrase></title>
</head>
<body>
$header
$navbar

<form action="test.php" method="post" name="vbform"<if condition="!is_browser('webtv')"> onsubmit="return vB_Editor['$editorid'].prepare_submit(this.subject.value, $vboptions[postminchars])"</if>>
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<if condition="$title">
<tr>
        <td class="alt2">
                Title: $title <br />
                Iconid: $iconid <br /><br />
                <hr />
                $message
        </td>
</tr>
</if>
<tr>
        <td class="tcat">Start New Message</td>
</tr>
<tr>
        <td class="panelsurround" align="center">
        <div class="panel">
                <div style="width:$stylevar[formwidth]" align="$stylevar[left]">

                $usernamecode

                <!-- subject field -->
                <table cellpadding="0" cellspacing="0" border="0" class="fieldset">
                <tr>
                        <td class="smallfont" colspan="3">$vbphrase[title]:</td>
                </tr>
                <tr>
                        <td><input type="text" class="bginput" name="subject" value="$subject" size="40" maxlength="85" tabindex="1" /></td>
                        <td>&nbsp;&nbsp;</td>
                        <td><img id="display_posticon" src="$selectedicon[src]" alt="$selectedicon[alt]" /></td>                </tr>
                </table>
                <!-- / subject field -->

                <table cellpadding="0" cellspacing="0" border="0">
                <tr>
                        <td>

                <!-- message area -->
                <div class="smallfont">$vbphrase[message]:</div>
                $messagearea
                <!-- / message area -->

                $posticons

                        </td>
                </tr>
                </table>

                </div>
        </div>

        <div style="margin-top:$stylevar[cellpadding]px">
                <input type="hidden" name="s" value="$session[sessionhash]" />
                <input type="hidden" name="f" value="$forumid" />
                <input type="hidden" name="do" value="postdata" />
                <input type="hidden" name="posthash" value="$posthash" />
                <input type="hidden" name="poststarttime" value="$poststarttime" />
                <input type="hidden" name="loggedinuser" value="$bbuserinfo[userid]" />
                <input type="submit" class="button" name="sbutton" id="{$editorid}_save" value="Sumbit Data" accesskey="s" tabindex="1" />
        </div>
        </td>
</tr>
</table>
</form>

$footer
</body>
</html>
Study whats going on here and you should be able to add this to any mod you want.
Attached Files
File Type: php test.php (3.2 KB, 34 views)
Reply With Quote
  #5  
Old 05-23-2006, 02:31 AM
whitejeep whitejeep is offline
 
Join Date: May 2006
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have taken a hard look at the HTML and the PHP how do i take the HTML you gave me to study let say the html code you gave me I attached to the bottom of my php file which is the test.php you sent me. unstead of your HTML code or with your html script i want to bring up a vBulletin page and have your HTML script come up in the body of the vbulletin page - what does vbulletin expect to see in the html so it can commucate with the php I know how to use post data to send data to the PHP script that is not what i am asking how do i get or find the HTML or is it a couple of function calls in the PHP or is it stuff in the HTML that needs to happen.

I will start by asking how and what do i have to do to bring up a blank vbulletin with the header and footer and of course the nav bar and a blank body so i can add my HTML in the the body of the vbulletin like the HTML you gave me to study. Use that is a example so we are talking on the same page but i reality i need to design my own liittle editor - I need to right now under stand the basic concept in how to get the basic vbulletin formated look and feel page displayed so i can use the vbulletin page to test me PHP scripts and send me data to the server. I hope I have been clear on what i need and thanks for the help you have given me in the past couple days. THANKS

i am problely doing this the hard or the wrong way it is called brute force and these are the steps I have taken.

Step one I took you the line eval('print_output("' . fetch_template('testpage') . '");'); in the little php file you sent me and commented out the line - not really undrestanding on what it does and how vbulletin uses the eval for please explain how that is used. The reason was the line came up with a blank screen and my debuging text which is a bunch of echo statements would not display with the eval('print_output("' . fetch_template('testpage') . '");'); but the other eval before that one eval('$navbar = "' . fetch_template('navbar') . '";'); I could leave in because it did not interfer with my echo debuging statements. I did this so i could have a clear path of echo telling me the path through the script.

Step 2 Add the HTML to the bottom of the test.php file and I got the HTML from the following brng up internet explorer and in the action bar typed this line newreply.php?do=newreply&noquote=1&p=2 this brought up the editor page in vbulletin and I grabed the HTML by copying it in to notepad after viewing the source using the right click on the mouse.

Step 3 After adding the HTML to the bottom of the PHP after the closing PHP tag of course and run the test.php on the server. By FTP the file to the server and bring it up in the browser I got the Vbulletin look and feel I wanted.

But I know that the PHP in vbulletin do not have HTML attached to the bottom of their PHP files so i can only assume it is functions that i can not find and I am intrested in how and where the HTML is located and how to correctly call the functions in my PHP scripts.

I have located some HTML that is what I want to use in the source i grabed and copyed to the bottom of my PHP file and this is the following:

<input type="hidden" name="wysiwyg" id="vB_Editor_001_mode" value="0" />

<script type="text/javascript">
<!--
vB_Editor['vB_Editor_001'] = new vB_Text_Editor('vB_Editor_001', 0, '2', '1');
//-->
</script>
<!-- / message area -->


<script type="text/javascript">
<!--
function swap_posticon(imgid)
{
var out = fetch_object("display_posticon");
var img = fetch_object(imgid);
if (img)
{
out.src = img.src;
out.alt = img.alt;
}
else
{
out.src = "clear.gif";
out.alt = "";
}
}


It is the message area that I need to understand How does vbulletin interface with the information that one types in the the text box and how does Vbulletin get the data to the database - ie there are two fields in the database table one is clean and one not clean - what functions do vbulletin use to do this process and the script above were can I find it in the vbulletin source code ie what functions does this code sit in. Also vbulletin uses some ajax code to instantly update data that the user types in and updates and live to the database.

Can you help me explain the things above of course my echo statements are not realy need to be done in your little program you sent me but i have been useing echo and print_r and var_dump to debug my PHP maybe you might have some other sujestion since i am new to PHP and some of the tools but not new to programing its self and so far find the tools alittle on the premitive side for debugging and allways looking for new ways to debug my scripts with tools provided in the lanagiage. THANKS

I have review many articals and the following 4 articals are the most helpful i would say. THANKS

[How-To] vBulletin API Basics: Creating Custom Pages & Misc.

[How to] Create pages for the AdminCP

Cache System Explanation (datastore)

[How-To] vBulletin API Basics: Variables, Functions, Objects

But i have a couple more direct questions to ask let me explain by posting a reply having to get around a problem i am having first. THANKS

How do I get around this basic problem - I have found that when i do a echo and have in my PHP script a eval(); like below I have to comment the eval out if i what to print my debug messages - why is this the case and how do i get around the problem any ideas.

echo 'This is a test message';
echo "<br>";

// eval('print_output("' . fetch_template('testpage') . '");');


I also use not only echo messages but var_dump and print_r as well as echo to debug my script - as you know i am kind of new to this PHP stuff not to mention the vbulletin stuff and the why things are done in vbulletin I do not know if this is just in vbulletin or a standard PHP and useing stardard output problems - if you could explain why and how I should get around the problem - if i was using another language i might use some # defines to get around the problem but i do not see that supported in PHP as of yet.

Oh by the way the following was a great artical that you if you are LiveWire the Master Coder did and posted in the totorial section of this forum and if you are not LiveWire it is a great artical you should check it out. THANKS LiveWire for the artical and the time you have given me in my postings and questions. THANKS from Whitejeep.

vB3.5 Modification Tutorials
Cache System Explanation (datastore)

by
LiveWire
Master Coder
Reply With Quote
  #6  
Old 05-27-2006, 12:53 AM
whitejeep whitejeep is offline
 
Join Date: May 2006
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok all my debug question have been resolveed thanks to adrian and his help i was able to get the debug problems with the following:

$header = print_r($navbits, true) . $header;

DEVDEBUG("FRANK H. SHAW TEST EDITOR HERE");

After enabling debuging in the config.php file amd inserting this line somewhere in the file.

$config['Misc']['debug'] = true;
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 04:06 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.03746 seconds
  • Memory Usage 2,261KB
  • Queries Executed 14 (?)
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_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (1)postbit_attachment
  • (6)postbit_onlinestatus
  • (6)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
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete