TinyMCE - Javascript WYSIWYG Editor

by MYLE 10. July 2010 01:57

its Cool easy to setup

Download From Here 

Only Problem Its a PHP code for the file management well that not a problem well There are work around for it

My first on is Little change

there is a Imagelist in the imagepopup that needs to be full

So this script will read all image in a folder and put them into a array so that the TinyMCE can read it.

folder = iif(trim(uploadsDirVar)="","D:\WWW\mel\Photos",uploadsDirVar)
ImgList  = server.MapPath("image_list.js")
writeTofile ImgList,"var tinyMCEImageList = new Array(",false
'folder = uploadsDirVar
set fso = CreateObject("Scripting.fileSystemObject") 
set fold = fso.getFolder(folder) 
aa=0
zz=fold.files.count
for each file in fold.files 
aa = aa + 1
writeTofile ImgList,"['" & replace(ucase(file.name),".JPG","") & "', 'Photos/" & file.name & "']" & iif(aa=zz,"",","),true 
Next
writeTofile ImgList,");",true

function WriteToFile(FileName, Contents, Append)
	on error resume next
	if Append = true then
	   iMode = 8
	else 
	   iMode = 2
	end if
	set oFs = server.createobject("Scripting.FileSystemObject")
	set oTextFile = oFs.OpenTextFile(FileName, iMode, True)
	oTextFile.Write Contents & vbnewline
	oTextFile.Close
	set oTextFile = nothing
	set oFS = nothing
end function

Function IIf(Condition_To_Check,TrueBit,FalseBit)
	If Condition_To_Check Then 
            IIf = TrueBit 
        Else 
            IIf = FalseBit
        End If
End Function

...

Now You need to point  TinyMCE to the right place look in the tinyMCE.init

look for

external_image_list_url : "lists/image_list.js",

change it to point to the same place where "ImgList = server.MapPath("image_list.js")" is point to

in my case its in a inc Folder so

external_image_list_url : "inc/image_list.js",

Done Tongue out

 

 

 

Breadcrumbs on a Site

by MYLE 30. June 2010 00:51

 

find these for this Blog Engine

  • Historical Breadcrumbs - Shows the last few pages visited
  • Hierarchical Breadcrumb Extension - Shows the user where they are on your blog
  • [Quoted : From webMonkey web site]
    There are two main ways of approaching breadcrumbs. The first is the kind left by Hansel and Gretel, which is of the form, 'I went here, then here, then here, then here'. I've labelled this kind of breadcrumb, 'History Breadcrumbs', because they show a browsing history.

    The second is of the form, 'I'm at this page, which is part of this section, which is part of this section'. I've called this kind 'Position Breadcrumbs' because they show the visitors current location in the site.

    [/Quoted]

    Webmonkey Javascript Version  Wink Has my Vote

    been a VB Man I wanted a ASP version as 

    Found the "Breadcrumbs for Those Using ASP"
    Like the coding tidy easy to follow but The thing I did't like was you had to use a PageTitle  

     

    IIF in ASP its does not have one so.

    by MYLE 25. June 2010 20:56

    Sometime you want to check condition in ASP well it does not have a IIF()

    so here it is

    Function IIf(Condition_To_Check,TrueBit,FalseBit)
    	If Condition_To_Check Then 
                IIf = TrueBit 
            Else 
                IIf = FalseBit
            End If
    End Function
    

    Display Time format

    by MYLE 21. June 2010 21:49

    I have been ask many time what the best way to store hours in a data base.
    as hour is a mod 60 what I do store MINS and use the below function to convert the mins to time format so
    if a job took me 1:30 I store the min value 90min then if a did and other hour store that as 60 then add the mins up 150min total pass the

    total = Mintohrs(150)
    

    total would show 02:30 HrstoMin

    Function Mintohrs(Tmin)
        hh = Int(Tmin / 60)
        tt = hh * 60
        mm = Tmin - tt
        Mintohrs = DIG(hh) & ":" & DIG(mm)
    End Function
    

    hourtomin

     my other Functions

    03:15 = Mintohrs(90+90+15)
    

    I use and other Function I wrote to format the Mins

    Age return

    by MYLE 21. June 2010 21:39

    some ask me need to know the age of someone to the Month ie 45.5 months don't know why but ....

    Function Age(Birth_Date,End_Date)
    '***************************************
    ' Works out the age of to the month
    '
    '***************************************
    Dim Months
    Dim Years
    Dim Temp
    If IsNull(Birth_Date) or Birth_Date ="" Then
        Age=0.0 
    else
        Months = DateDiff("m", CDate(Birth_Date), End_Date)
        Years = Int(Months / 12)
        Temp = Years * 12
        If Years = 0 then Years = "" 
        Age =  Years & "." & Months - Temp
    End if
    End Function
    
    MyAge = age(DOB,now())
    

    Writeit

    by MYLE 15. June 2010 08:23

    Every now and them you want to Show something on a ASP page

     
    Sub Writeit(This,This1)
    	Response.Write "< strong >" & This & "< / strong > = [" & This1 & "]
    " end sub

    so in the  ASP just do a Call Writeit("SQL",SQL)

    and in the Out put it will show showing you the Value of SQL

    SQL = [SELECT * FROM CUSTOMER]

     

    Dislexia

    I see people have commented about my style of writting.
    Well I have dislexia so spelling is not one of my good points
    but when it comes to reading/written code thats the easy bit.

     

     

    Poll

    What Search Engine Do you use




    Show Results

    Disclaimer of Liability

    While every effort will be made to ensure that the information contained within this website is accurate and up to date, The Company's listed with this web site and any associated parties, make no warranty, representation or undertaking, whether expressed or implied, nor does it assume any legal liability, whether direct or indirect, or responsibility for the accuracy, completeness, or usefulness of any information.

     

    Google Ads

    Most comments

    carpet cleaning forest lake carpet cleaning forest lake
    1 comments
    us United States
    carpet cleaning capalaba carpet cleaning capalaba
    1 comments
    us United States

    RecentComments

    Comment RSS