Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: May 1999
Posts: 39
Journeyman
Journeyman
Offline
Joined: May 1999
Posts: 39
I want my PM HTML enabled (for all users) , is it possible ?
What scripts should I modified ?

Is it function doPreview() of ubb_jslib.js ?
How should I modify it ?

This is the most important function my site required.
If not solved , I have to stay with UBB6.5.
Can anybody help me , very thanks....

Last edited by smallufo; 10/12/2007 5:55 PM.
Sponsored Links
Joined: Feb 2007
Posts: 329
Yarp™
Yarp™
Offline
Joined: Feb 2007
Posts: 329
If you want to set it so all PM's proces both html and ubbcode, change this line in /scripts/sendmessage.inc.php

Code
	$Message = $html -> do_markup($Message,"post","markup");

with
Code
	$Message = $html -> do_markup($Message,"post","both");

This not handle preview correctly yet.

All in all, there is no need to fiddle around in javascript whatsoever, it's mostly stuff that calls php scripts for the actual work.

Last edited by blaaskaak; 10/15/2007 3:40 AM.
Joined: May 1999
Posts: 39
Journeyman
Journeyman
Offline
Joined: May 1999
Posts: 39
Hi , thanks
But I still need HTML enabled in preview.

Joined: Feb 2007
Posts: 329
Yarp™
Yarp™
Offline
Joined: Feb 2007
Posts: 329
Okay. Do you allow html forumwide or just in PM's?

And if so, do you want users to be able to toggle whether or not to use html?

Joined: May 1999
Posts: 39
Journeyman
Journeyman
Offline
Joined: May 1999
Posts: 39
HTML enabled/disabled is based on forum option.
The forum doesn't need to be changed.

I want HTML enabled (including preview) for everyone in PM.

Sponsored Links
Joined: Feb 2007
Posts: 329
Yarp™
Yarp™
Offline
Joined: Feb 2007
Posts: 329
Okay done!

The thing I said to edit in /scripts/sendmessage.inc.php, do the same for /scripts/mess_reply.inc.php

This will make sure both html and ubb code markup is available in all PM's.

You also need to edit 3 templates for the preview to work:

You need to add this line:
Code
<input type="hidden" name="convert" value="both" />

to
/templates/default/viewmessage.tpl
after
Code
<input type="hidden" name="ubb" value="mess_reply" />

/templates/default/mess_handler.tpl
after
Code
<input type="hidden" name="ubb" value="mess_reply" />

/templates/default/sendprivate.tpl
after
Code
<input type="hidden" name="ubb" value="sendmessage" />

These edits adds the variable convert to the forms, which tells the preview engine how to markup the message.

Let me know if it works please!

Last edited by blaaskaak; 10/15/2007 10:29 AM.
Joined: May 1999
Posts: 39
Journeyman
Journeyman
Offline
Joined: May 1999
Posts: 39
It works , thank you very much.
I don't know how to express my appreciation. You helped me a lot.
Now I can finally grade to UBB7.

Joined: Feb 2007
Posts: 329
Yarp™
Yarp™
Offline
Joined: Feb 2007
Posts: 329
We might be a bit slow sometimes here, but we get the job done laugh

So you are very welcome. Luckely the hack is so simple, that it is very easy to implement in new versions again if you upgrade again the future.

Last edited by blaaskaak; 10/15/2007 1:53 PM.
Joined: May 1999
Posts: 39
Journeyman
Journeyman
Offline
Joined: May 1999
Posts: 39
Hi , I found the "replier" still cannot correctly preview HTML when they reply.
No matter Quick Reply or Full Reply Screen , the Preview screen cannot correctly display HTML.
But the sent message can display correct HTML.

Which parts should I modify now ?

Joined: Feb 2007
Posts: 329
Yarp™
Yarp™
Offline
Joined: Feb 2007
Posts: 329
Is that both from the quick reply and the actual reply screen?

Sponsored Links
Joined: Feb 2007
Posts: 329
Yarp™
Yarp™
Offline
Joined: Feb 2007
Posts: 329
Originally Posted by blaaskaak
Is that both from the quick reply and the actual reply screen?


Ehr, forget me asking, you already gave the answer. It's around 2 am here now, so I can't look into it anymore tonight, but I'll get back to you about this tomorrow.

If you give me your board url (you could PM me if you want to keep it private) I could take a look at your forum to see what's going wrong.

Joined: May 1999
Posts: 39
Journeyman
Journeyman
Offline
Joined: May 1999
Posts: 39
Hi
The server is located in intranet , not connectable from internet.
It's my test platform , to ensure everything works.
If everything works fine , I'll deploy to internet site.


Joined: May 1999
Posts: 39
Journeyman
Journeyman
Offline
Joined: May 1999
Posts: 39
I look into the Quick Reply form , found there has been a hidden field :
input type="hidden" name="convert" value="both"
But why it still cannot preview HTML ...
URL is : ubbthreads.php?ubb=viewmessage&message=266324&gonew=0
The source code is :
Code

<form method="post" action="/ubbthreads722/ubbthreads.php" name="replier">
<br />
<br />
</td>
<td class="alt-1" width="83%">
<input type="hidden" name="ubb" value="mess_reply" />
<input type="hidden" name="convert" value="both" />
<input type="hidden" name="Number" value="266324" />
<input type="hidden" name="Parent" value="266324" />
<input type="hidden" name="id" value="266328" />
<input type="hidden" name="quickreply" value="1" />
<textarea cols="65" rows="10" class="form-input" name="Body"></textarea>
<br />
<input type="submit" name="textcont" value="Submit" class="form-button" />
<input type="button" name="textcont" value="Preview Reply" class="form-button" onclick="doPreview();" />
<input type="button" name="textcont" value="Switch to Full Reply Screen" class="form-button" onclick="switchAdvanced('pt');" />
</form>
</td>

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


<div id="preview_area" style="display: none;">
<table width="100%" class="t_outer" cellpadding="0" cellspacing="0">
<tr>
<td>
<table width="100%" class="t_inner" cellpadding="0" cellspacing="1">
<tr>
<td class="tdheader">
Preview
</td>
</tr>

<tr>
<td class="alt-1">
<span id="preview_text">
</span>
</td>
</tr>
</table>
</td>
</tr>
</table>

Joined: May 1999
Posts: 39
Journeyman
Journeyman
Offline
Joined: May 1999
Posts: 39
ok , I found where goes wrong.
Because of previewpost.inc.php's limitation , it only allows Admin to pewview HTML .
After I comment out the four lines below , every user can preview HTML :
Code

// if ($user['USER_MEMBERSHIP_LEVEL'] == "User") {
// if (($convert == "both" || $convert == "html") && $HTML != 1) {
// $convert = "none";
// } // end if
// } // end if

Why UBBThreads set this limitation ?

Joined: Jan 2000
Posts: 5,834
Likes: 20
UBBDev Owner
Time Lord
UBBDev Owner
Time Lord
Joined: Jan 2000
Posts: 5,834
Likes: 20
You'd have to ask rick, but I'm sure it's for security, as allowing HTML allows people to embed anything they want, including code which can steal user cookies or replace all of your images on that page with non-appropriate images...


UBBDev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.threads: My UBB Themes, My UBB Scripts
Joined: May 1999
Posts: 39
Journeyman
Journeyman
Offline
Joined: May 1999
Posts: 39
well , I think ubbthreads should incorporate a more fine-grained HTML control mechanism .
Such as only allow A TABLE TH/TR/TD FONT "Safer" tags and disallow SCRIPT IMG EMBED OBJECT ...etc.
Maybe it can depend on the user role , allowing which role can use which tags ...etc.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,575
Posts293,931
Members13,824
Most Online6,139
Sep 21st, 2024
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
Gizmo 1
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)