Avatar billede stairway_to_heaven Nybegynder
03. november 2002 - 17:42 Der er 12 kommentarer

Blogger..!

Hej Hej


Se lige her: www.krellers.dk/blog1/easyblogadmin.asp
Hvad kan fejlen være...?

Her er readme filen
##############################################################################
# EasyBlogAsp                            Version 1.0                          #
# Copyright 2002 hampton-smith    sam@hampton-smith.com                    #
# PHP, Flash, ASP and Perl from http://www.dotdragnet.co.uk/                #
##############################################################################
# This script is copyright 2002, sam@hampton-smith.com www.hampton-smith.com #
#                                                                            #
# COPYRIGHT NOTICE                                                          #
# Copyright 2002 hampton-smith.com  All Rights Reserved.                    #
#                                                                            #
# This script may be used and modified free of charge by anyone so long as  #
# this copyright notice and the comments above remain intact.  By using this #
# script and its associated files, you agree to indemnify hampton-smith and  #
# all other interested parties from any liability that might arise from      #
# it's use.                                    #
#                                                                            #
# Selling the code for this program without prior written consent is        #
# expressly forbidden.  Obtain permission before redistributing this        #
# script over the Internet or in any other medium. In all cases copyright    #
# and header must remain intact.                                            #
#                                                                            #
# Without express permission from hampton-smith, you may under no         #
# circumstances remove the link to www.dotdragnet.co.uk from the pages that  #
# this script creates.                                                      #
#                                                                            #
# I also request that should you make any improvements to this script,      #
# please be kind enough to let me know so that I may improve mine        #
# for the rest of the people who use it.                                    #
##############################################################################

Easy Blog Asp v1.0

- this is the easiest Blog/News application you will ever find!
- it allows you to customise fully from within the application;
- Just follow the instructions below for setup


Instructions for use:


New Users
---------

1) Upload all the files (excluding readme.txt) to http://www.your-domain.com/blog
2) point your broswer at http://www.your-domain.com/blog/easyblogadmin.asp
3) Enter the password "password" when prompted
4) When you get the admin screen appear, click on "Change Admin Details" to customise the application to your needs - change the password etc
5) Use this code to include the blog within your site: <!-- #INCLUDE FILE="blog/easyblog.asp"--> - you can then add blogs from the easyblogadmin.asp page
6) The blog will also work stand-alone - you could open it in a small window if you wanted to
7) That's it! Job done!


Customising the appearance of the forms
***************************************

All the appearance is controlled from within a cascading style sheet called easyblog.css.
Changing this will change the fonts used, the colours, the buttons appearance and so on.
The blog will always expand to fill 100% of the space you give it - so if you want a little
blog on your screen, only give it a little space. Please leave the "powered by EasyBlogAsp"
message in place - fair's fair! However, if you want to remove the notice, you can do so by
donating UK£5 to dotdragnet. Click on "help me" in the admin pages for more details

If you want help with css, or need an introduction - visit the webmaster resources section
of http://www.dotdragnet.co.uk for tutorials and relevant links, and the forums at
http://www.dotdragnet.co.uk/forum to speak to the experts!


Getting a 500 Error?

This is common when you haven't got read and write access to your server - speak to your
web-host to ensure that you are allowed to write on the server as well as read from it.
That will solve 99% of the errors you may encounter with this script.


Other problems/Feedback

Having other problems with this script ?  Got suggestions for improvements ?
Check out the dotdragnet Web Builder forum. Please bear in mind that this is
version 1.0 so it may still be a bit buggy ;)  Remember to check back on a regular
basis as we will be releasing new versions of this poll script constantly.

http://www.dotdragnet.co.uk
Avatar billede medions Nybegynder
03. november 2002 - 17:59 #1
Det er din sti til filen der er forkert!

-din fil eksister evt. ikke!

//>Rune
Avatar billede stairway_to_heaven Nybegynder
03. november 2002 - 18:04 #2
der findes en fil i den mappe der hedder blog_prefs.asp hvordan retter jeg det?
Avatar billede medions Nybegynder
03. november 2002 - 18:06 #3
Lad mig lige se din fil!

//>Rune
Avatar billede stairway_to_heaven Nybegynder
03. november 2002 - 18:10 #4
<% language="vbscript"%>
<!-- #INCLUDE FILE="blog_config.asp" -->
<!-- #INCLUDE FILE="blog_prefs.asp" -->

<!--
##############################################################################
# EasyBlogAsp                            Version 1.0                          #
# Copyright 2002 hampton-smith    sam@hampton-smith.com                    #
# PHP, Flash, ASP and Perl from http://www.dotdragnet.co.uk/                #
##############################################################################
# This script is copyright 2002, sam@hampton-smith.com www.hampton-smith.com #
#                                                                            #
# COPYRIGHT NOTICE                                                          #
# Copyright 2002 hampton-smith.com  All Rights Reserved.                    #
#                                                                            #
# This script may be used and modified free of charge by anyone so long as  #
# this copyright notice and the comments above remain intact.  By using this #
# script and its associated files, you agree to indemnify hampton-smith and  #
# all other interested parties from any liability that might arise from      #
# it's use.                                    #
#                                                                            #
# Selling the code for this program without prior written consent is        #
# expressly forbidden.  Obtain permission before redistributing this        #
# script over the Internet or in any other medium. In all cases copyright    #
# and header must remain intact.                                            #
#                                                                            #
# Without express permission from hampton-smith, you may under no         #
# circumstances remove the link to www.dotdragnet.co.uk from the pages that  #
# this script creates.                                                      #
#                                                                            #
# I also request that should you make any improvements to this script,      #
# please be kind enough to let me know so that I may improve mine        #
# for the rest of the people who use it.                                    #
##############################################################################
-->

<link rel="stylesheet" href="easyblog.css">
<%



' EasyBlogAsp - the easiest Blog and news script to set up in the world!
' Hand written by SamHS, for dotdragnet.co.uk - copyright retained on the original script by hampton-smith.com
' However, you may alter and distribute this script - so long as you retain the copyright notices
' For support or help, visit the forums at http://www.dotdragnet.co.uk

' DO NOT ALTER BELOW THIS LINE
' ****************************
Passwordchecker()

Sub displaypage()
Select Case request("action")
    Case "addentry"
        addentry
    Case "editcss"
        editcss
    Case "editentry"
        editentry
    Case "deleteentry"
        removeentry
    Case "viewsummary"
        showentries
    Case "updatedetails"
        updatedetails
    Case "help"
        showhelp
    Case "smileys"
        smileymanager
    Case Else
        welcomeform
End Select
End Sub

sub welcomeform()
topadtable
%>
<tr><td colspan=4 align="center">
<h4>Welcome to EasyBlogAsp</h4>
This Blog/News application has been designed to be very easy to use, but if you are experiencing problems - please take a visit to <a href="http://www.dotdragnet.co.uk">http://www.dotdragnet.co.uk</a> and either browse through our tutorials on asp and css, or post a support question in our forums<p>To get started, click on one of the admin options from below</td></tr>
<%
adminform
bottomadtable
End Sub

sub showentries()
topadtable
    Response.write "<tr><td colspan=""4""><h4>Summary of entries</h4></td><tr>"
    Response.write "<tr><td colspan=""4""><table width=""100%"">"
    Response.write "<tr><td><b>Date</b></td><td><b>Title</b></td><td><b>Summary</b></td><td><b>Length</b></td><td><b>Filename</b></td></tr>"   
    blogfile = Server.MapPath("myblogindex.txt")
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objCountFile = objFSO.OpenTextFile(blogfile, 1, True)
    news=objCountFile.ReadAll
    objCountFile.Close
    Set objCountFile = Nothing   
    Set objFSO = Nothing
    filenames=Split(news, "**")
    numrecords = Ubound(filenames)
    for i = 1 to numrecords
        bloginfo=split(filenames(i), "%%%")
        Response.Write "<tr><td>" & FormatDateTime(bloginfo(1), formdate) & "</td><td>" & bloginfo(2) & "</td><td>" & bloginfo(3) & "</td><td>" & bloginfo(4) & "</td><td>" & bloginfo(5) & "</td><td><a title=""Edit this entry"" href=""" & thisscript & "?action=editentry&idnumber=" & bloginfo(0) & """><b>Edit</b></a></td><td><a title=""Delete this entry"" href=""" & thisscript & "?action=deleteentry&idnumber=" & bloginfo(0) & """><b>X</b></a></td></tr>"
    Next
    Response.write "</table></td/></tr>"
adminform
bottomadtable
End Sub

sub welcomeform()
topadtable
%>
<tr><td colspan=4 align="center">
<h4>Welcome to EasyBlogAsp</h4>
This Blog/News application has been designed to be very easy to use, but if you are experiencing problems - please take a visit to <a href="http://www.dotdragnet.co.uk">http://www.dotdragnet.co.uk</a> and either browse through our tutorials on asp and css, or post a support question in our forums<p>To get started, click on one of the admin options from below</td></tr>
<%
adminform
bottomadtable
End Sub

sub showhelp()
topadtable
    Response.write "<tr><td colspan=""4""><h4>EasyBlogAsp help</h4></td><tr>"
    Response.write "<tr><td colspan=""4"">"
%>
<div align="left">
<p><b>Setting up the include</b><br />
In order to include the blog into your page, you'll need to do one of the following:<br />
<ul>
<li><b>Use an SSI include:</b><br />Include the easyblog.asp file into your existing SSI compatable page (.asp files are fine for this) using code such as this:<br /><<b></b>!<b></b>-- #include file="blog/easyblog.asp" --<b></b>></li>
<li><b>Use an i-frame:</b><br />Include the easyblog.asp file as an iframe src like this:<br /><<b></b>iframe src="blog/easyblog.asp" width="200" height="400" name="blog"<b></b>></li>
</ul>
<p><b>EasyBlogAsp</b> has been designed to be really easy to use - just upload the files to your webserver and it will work, but there are a few things that can go wrong:</p>
<p><ul>
<li><b>I can't add a new entry/edit an existing entry - I get an error message</b><br />This is most likely caused by you not having permissions to write data to the server. Speak to your host to ensure you have the relevent write permissions on the folder you have installed the EasyBlogAsp script into</li>
<li><b>I can't delete a new entry</b><br />Again this is almost certainly due to permissions problems. Speak to your host to make sure you have delete permissions on the folder in question</li>
<li><b>I get an error on the blog summary page/summary view on my include</b><br />Have you deleted the index file? EasyBlogAsp requires the file myblogindex.txt to operate - without this all your blogs are useless and the script will not execute correctly!</li>
<li><b>I want to opt not to display [insert field of your choice] on the summary/detail view on my site</b><br />The look and feel of the blog is entirely controlled with CSS (cascading style sheets). You can choose not to display a particular element on the page by setting the "display" value to none for any particular style. The CSS as provided with EasyBlogAsp is fully commented to help you make changes as easily as possible.</li>
<li><b>I want to remove the copyright notices</b><br />You can legally remove the copyright notices by making a donation of £5 (about $8) to dotdragnet. <a href="http://www.paystamp.com/donate/donate.asp?affid=dotdragnet-45"><b>Click here to make a donation</b></a>. You can use your credit card, or if you're in the UK you can send in a cheque or postal order. Send a copy of the confirmation email to sam@hampton-smith.com and I'll email you back a copy of the script without the copyright notices. Please note that I periodically check on sites using my scripts to make sure the copyright notices are in tact as per the licensing agreement, so if you want to use this script without it cough up - a fiver is nothing to you or me, but will help dotdragnet survive and provide it's excellent resources for some time to come.</li>
</ul>
</p>
<p><b>EasyBlogAsp</b> operates without using a database making it accessible to all, but this does mean that it generates a fair few text files. Each individual blog is stored in it's own text file. The script is very easy to upgrade to make use of a database though, and once again if you email me confirmation of a donation to dotdragnet, I'll happily send you a version that uses a SQLServer or Access backend instead of text files. Note that you should not delete any of the text files generated by the script directly, but should use the delete functionality within the script itself. This way the entry in the index file will be removed as well - preventing future errors.</p>
<p><b>NOTE:</b> this script creates files to store your blogs - do not delete any file beginning myblog... I recommed you install this script into it's own directory so you can keep all the files organised in one place.</p>
<p>If you are continuing to experience difficulties please do not send email to either the author or dotdragnet. Emails requesting support will be ignored. For personalised help, please visit the forums at <a href="http://www.dotdragnet.co.uk/forum"><b>http://www.dotdragnet.co.uk</b></a>.
</p>
</div>
<%
    Response.write "</td/></tr>"
adminform
bottomadtable
End Sub

Sub adminform()
%>
<tr><td colspan="4"><hr><h4>Admin Options</h4></td></tr>
<tr><td colspan="4"><table width="100%"><tr><td><form action="<%=scriptname%>" method=post>
<input type=hidden name="action" value="addentry">
<input class="buttons" type=submit value="New Blog entry" id=submit1 name=submit1>
</form></td><td><form action="<%=scriptname%>" method=post>
<input type=hidden name="action" value="viewsummary">
<input class="buttons" type=submit value="Blog summary">
</form></td><td><form action="<%=scriptname%>" method=post>
<input type=hidden name="action" value="updatedetails">
<input class="buttons" type=submit value="Admin details">
</form></td><td><form action="<%=scriptname%>" method=post>
<input type=hidden name="action" value="smileys">
<input class="buttons" type=submit value="Smiley Manager">
</form></td><td><form action="<%=scriptname%>" method=post>
<input type=hidden name="action" value="editcss">
<input class="buttons" type=submit value="Edit CSS">
</form></td><td><form action="<%=scriptname%>" method=post>
<input type=hidden name="action" value="help">
<input class="buttons" type=submit value="Help me!">
</form></td></tr></table></td></tr>
<%
displaylogout()
End sub

Sub removeentry()
    topadtable
If request("idnumber")="" Then
%>
<tr><td colspan="4"><hr><h4>Delete an entry</h4></td></tr>
<tr><td><form action="<%=thisscript%>" method="post">
<input type="hidden" name="action" value=deleteentry">
Enter the id number of the record to delete:
<input type="text" name="idnumber" size="20"><br />
<input class="buttons" type=submit value="Delete this entry">
</form></td></tr>
<%
Else
    Response.write "<tr><td colspan=""4""><h4>Delete an entry</h4>"
    idnumber=Request("idnumber")
    blogfile = Server.MapPath("myblogindex.txt")
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objCountFile = objFSO.OpenTextFile(blogfile, 1, True)
    news = objCountFile.ReadAll
    objCountFile.Close
    Set objCountFile = Nothing   
    Set objFSO = Nothing
    userrecord=Split(news, "**")
    numrecords = Ubound(userrecord)
    flag=0
    finalstr=""
    for i = 1 to numrecords
    counter=Split(userrecord(i), "%%%")
    If counter(0)=idnumber Then
        ' Remove file from system - must have permissions set to allow this....
        killfile = Server.MapPath("myblog" & counter(0) & ".txt")
        Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
        objFSO.DeleteFile(killfile)
        flag=1
    Else
        finalstr=finalstr & "**" & userrecord(i)
    End If
    Next
    finalstr=Trim(finalstr)
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objTextFile = objFSO.CreateTextFile(blogfile)
    objTextFile.WriteLine finalstr
    objTextFile.Close
    Set objTextFile = Nothing
    Set objFSO = Nothing
    If flag=1 Then
        Response.Write "This entry has been deleted."
    Else
        Response.Write "Error: an error has occured because the entry could not be found, or the corresponding file was not present."
    End If
    Response.Write "</td></tr>"
End If
    adminform
    bottomadtable
End Sub

Sub updatedetails()
    topadtable
If request("password")="" Then
%>
<tr>
    <td colspan=4>
    <h4>Change Admin details</h4>
    Make changes below as required to customise EasyBlogAsp to your liking.<br><p>
    <form action="<%=scriptname%>" method=post>
    <input type=hidden name="action" value="updatedetails">
    Password:<br><input size=20 type=text name="password" value="<%=password%>"><p>
    Choose your locality (effects the date/time display)<br />
    <select name="lcid">
        <option value="2057" <%if lcid="2057" then Response.Write "selected"%>>United Kingdom</option>
        <option value="1033" <%if lcid="1033" then Response.Write "selected"%>>United States</option>
    </select><p>
    Choose a date/time display<br />
    <select name="formdate">
        <option value="0" <%if formdate=0 then Response.Write "selected"%>>13/12/01 12:00 AM</option>
        <option value="1" <%if formdate=1 then Response.Write "selected"%>>Monday, 13 December, 2001</option>
        <option value="2" <%if formdate=2 then Response.Write "selected"%>>13/12/01</option>
    </select><p>
    Number of records to show per page:<br><input size=10 type=text name="recordsperpage" value="<%=recordsperpage%>"><p>
    Show summary only, with click through to see actual blog (if no is chosen title, time and post will be displayed by default)<br />
    <select name="usesummary"><option value="yes" <%if usesummary="yes" then Response.Write "selected"%>>Yes - use a summary</option><option value="no" <%if usesummary="no" then Response.Write "selected"%>>No - just show the entries straight off</option></select><p>
    <input type=submit class="buttons" value="Update">
    </form>
    </td>
</tr>
<%
Else
    prefs=Server.MapPath("blog_prefs.asp")
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objTextFile = objFSO.CreateTextFile(prefs)
    sitename=Replace(Request.Form("sitename"), """", "'")
    objTextFile.WriteLine "<" & chr(37)
    objTextFile.WriteLine "session.lcid=" & request("lcid")
    objTextFile.WriteLine "lcid=" & request("lcid")
    objTextFile.WriteLine "formdate=" & request("formdate")
    objTextFile.WriteLine "scriptname=Request.ServerVariables(" & chr(34) & "script_name" & chr(34) & ")"
    objTextFile.WriteLine "password = " & chr(34) & request.form("password") & chr(34)
    objTextFile.WriteLine "usesummary = " & chr(34) & request.form("usesummary") & chr(34)
    objTextFile.WriteLine "recordsperpage = " & request.form("recordsperpage")
    objTextFile.WriteLine chr(37) & ">"
    objTextFile.Close
    Set objTextFile = Nothing
    Set objFSO = Nothing
%>
<tr>
    <td colspan=4>
    <h4>Change Admin details</h4>
    All changes have been made
    </td>
</tr>
<%
End If
    adminform
    bottomadtable
End Sub

Sub addentry()
    topadtable
If request("title")="" Then
%>
<tr>
    <td colspan=4>
    <h4>Add an entry</h4>
    <p>Complete the details below to add your new entry<br />
    <form action="<%=scriptname%>" method=post>
    <input type=hidden name="action" value="addentry">
    Title:<br><input size="100" maxlength="100" type="text" name="title" value="<%=title%>"><p>
    Summary:<br><input size="100" maxlength="100" type="text" name="summary" value="<%=summary%>"><p>
    Entry text:<br><textarea cols="100" rows="20" name="entry" value="<%=replace(entry, "<br />", vbcrlf)%>"></textarea><p>
    <input type=submit class="buttons" value="Add this entry">
    </form></p>
    </td>
</tr>
<%
Else
    blogfile = Server.MapPath("myblogindex.txt")
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objCountFile = objFSO.OpenTextFile(blogfile, 1, True)
    news = objCountFile.ReadAll
    objCountFile.Close
    Set objCountFile = Nothing   
    Set objFSO = Nothing
    userrecord=Split(news, "**")
    counter=Split(userrecord(1), "%%%")
    thecount=Cint(counter(0))+1
    thefile=Server.MapPath("myblog" & thecount & ".txt")
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objTextFile = objFSO.CreateTextFile(thefile)
    entry=blogencode(request("entry"))
    title=blogencode(request("title"))
    summary=blogencode(request("summary"))
    objTextFile.WriteLine title & "%%%" & now() & "%%%" & summary & "%%%" & entry
    objTextFile.Close
    Set objTextFile = Nothing
    Set objFSO = Nothing
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objCountFile = objFSO.OpenTextFile(blogfile, 1, True)
    news = objCountFile.ReadAll
    objCountFile.Close
    Set objCountFile = Nothing   
    Set objFSO = Nothing
    news="**" & thecount & "%%%" & now() & "%%%" & title & "%%%" & summary & "%%%" & len(entry) & "%%%" & "myblog" & thecount & ".txt" & news
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objTextFile = objFSO.CreateTextFile(blogfile)
    objTextFile.WriteLine news
    objTextFile.Close
    Set objTextFile = Nothing
    Set objFSO = Nothing
%>
<tr>
    <td colspan=4>
    <h4>Add an entry</h4>
    Your new entry has been added
    </td>
</tr>
<%
End If
    adminform
    bottomadtable
End Sub


Sub editentry()
    topadtable
If request("title")="" Then
    blogfile = Server.MapPath("myblog" & request("idnumber") & ".txt")
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objCountFile = objFSO.OpenTextFile(blogfile, 1, True)
    news = objCountFile.ReadAll
    objCountFile.Close
    Set objCountFile = Nothing   
    Set objFSO = Nothing
    userrecord=Split(news, "%%%")
    title=blogdecode(userrecord(0))
    thetime=userrecord(1)
    summary=blogdecode(userrecord(2))
    theentry=blogdecode(userrecord(3))
%>
<tr>
    <td colspan=4>
    <h4>Edit an entry</h4>
    <p>Complete the details below to add your new entry<br />
    <form action="<%=scriptname%>" method=post>
    <input type="hidden" name="idnumber" value="<%=request("idnumber")%>">
    <input type="hidden" name="thetime" value="<%=thetime%>">
    <input type=hidden name="action" value="editentry">
    Title:<br><input size="100" maxlength="100" type="text" name="title" value="<%=title%>"><p>
    Summary:<br><input size="100" maxlength="100" type="text" name="summary" value="<%=summary%>"><p>
    Entry text:<br><textarea cols="100" rows="20" name="entry"><%=theentry%></textarea><p>
    <input type=submit class="buttons" value="Update this entry">
    </form></p>
    </td>
</tr>
<%
Else
    thefile=Server.MapPath("myblog" & request("idnumber") & ".txt")
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objTextFile = objFSO.CreateTextFile(thefile)
    entry=blogencode(request("entry"))
    title=blogencode(request("title"))
    summary=blogencode(request("summary"))
    objTextFile.WriteLine title & "%%%" & request("thetime") & "%%%" & summary & "%%%" & entry & "%%%"
    objTextFile.Close
    Set objTextFile = Nothing
    Set objFSO = Nothing
    blogfile = Server.MapPath("myblogindex.txt")
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objCountFile = objFSO.OpenTextFile(blogfile, 1, True)
    news = objCountFile.ReadAll
    objCountFile.Close
    Set objCountFile = Nothing   
    Set objFSO = Nothing
    userrecord=Split(news, "**")
    For i=1 to ubound(userrecord)
        counter=Split(userrecord(i), "%%%")
        If counter(0)=request("idnumber") then
            finalstr=finalstr & "**" & request("idnumber") & "%%%" & request("thetime") & "%%%" & title & "%%%" & summary & "%%%" & len(entry) & "%%%" & "myblog" & request("idnumber") & ".txt"
        else
            finalstr=finalstr & "**" & userrecord(i)
        End If
    Next
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objTextFile = objFSO.CreateTextFile(blogfile)
    objTextFile.WriteLine finalstr
    objTextFile.Close
    Set objTextFile = Nothing
    Set objFSO = Nothing
%>
<tr>
    <td colspan=4>
    <h4>Edit an entry</h4>
    Your entry has been updated
    </td>
</tr>
<%
End If
    adminform
    bottomadtable
End Sub


Sub editcss()
    topadtable
If request("body")="" Then
    blogfile = Server.MapPath("easyblog.css")
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objCountFile = objFSO.OpenTextFile(blogfile, 1, True)
    news = objCountFile.ReadAll
    objCountFile.Close
    Set objCountFile = Nothing   
    Set objFSO = Nothing
%>
<tr>
    <td colspan=4>
    <h4>Edit EasyBlogAsp CSS</h4>
    <p>Edit the CSS sheet below, then click save to make changes<br />
    <form action="<%=scriptname%>" method=post>
    <input type=hidden name="action" value="editcss">
    <textarea cols="100" rows="40" name="body"><%=news%></textarea><p>
    <input type=submit class="buttons" value="Save Changes">
    </form></p>
    </td>
</tr>
<%
Else
    thefile=Server.MapPath("easyblog.css")
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objTextFile = objFSO.CreateTextFile(thefile)
    objTextFile.WriteLine request("body")
    objTextFile.Close
    Set objTextFile = Nothing
    Set objFSO = Nothing
%>
<tr>
    <td colspan=4>
    <h4>Edit EasyBlogAsp CSS</h4>
    Your cascading style sheet has been updated
    </td>
</tr>
<%
End If
    adminform
    bottomadtable
End Sub

Sub smileymanager()
    topadtable
   
Select Case request("method")
Case "new"
' add a record
    blogfile = Server.MapPath("smileys.txt")
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objCountFile = objFSO.OpenTextFile(blogfile, 1, True)
    news = objCountFile.ReadAll
    objCountFile.Close
    Set objCountFile = Nothing   
    Set objFSO = Nothing
    finalstr=news & "**" & request("id") & "%%%" & request("code") & "%%%" & request("url")
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objTextFile = objFSO.CreateTextFile(blogfile)
    objTextFile.WriteLine finalstr
    objTextFile.Close
    Set objTextFile = Nothing
    Set objFSO = Nothing
    %>
    <tr>
    <td colspan=4>
    <h4>Add a new Smiley</h4>
    Your new smiley was added
    </td>
</tr>
<%
showsmileyedit
Case "edit"
' edit a record
    blogfile = Server.MapPath("smileys.txt")
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objCountFile = objFSO.OpenTextFile(blogfile, 1, True)
    news = objCountFile.ReadAll
    objCountFile.Close
    Set objCountFile = Nothing   
    Set objFSO = Nothing
    smileycount=Split(news, "**")
    For i=1 to Ubound(smileycount)
        breakout=split(smileycount(i), "%%%")
        If breakout(0)=request("id") Then
            finalstr=finalstr & "**" & request("id") & "%%%" & request("code") & "%%%" & request("url")
        Else
            finalstr=finalstr & "**" & smileycount(i)
        End If
    Next
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objTextFile = objFSO.CreateTextFile(blogfile)
    objTextFile.WriteLine finalstr
    objTextFile.Close
    Set objTextFile = Nothing
    Set objFSO = Nothing
    %>
    <tr>
    <td colspan=4>
    <h4>Edit Smiley</h4>
    The selected smiley was updated.
    </td>
</tr>
<%
showsmileyedit
Case "delete"
' delete a record
    blogfile = Server.MapPath("smileys.txt")
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objCountFile = objFSO.OpenTextFile(blogfile, 1, True)
    news = objCountFile.ReadAll
    objCountFile.Close
    Set objCountFile = Nothing   
    Set objFSO = Nothing
    smileycount=Split(news, "**")
    For i=1 to Ubound(smileycount)
        breakout=split(smileycount(i), "%%%")
        If breakout(0)=request("id") Then
            ' Do nothing - we're deleting it!
        Else
            finalstr=finalstr & "**" & smileycount(i)
        End If
    Next
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objTextFile = objFSO.CreateTextFile(blogfile)
    objTextFile.WriteLine finalstr
    objTextFile.Close
    Set objTextFile = Nothing
    Set objFSO = Nothing
    %>
    <tr>
    <td colspan=4>
    <h4>Delete Smiley</h4>
    The selected smiley was deleted. No further instances with that code will be converted, but any existing entries will continue to point at the image you specified
    </td>
</tr>
<%
showsmileyedit   
Case Else
%>
<tr>
    <td colspan=4>
    <h4>EasyBlogAsp Smiley Manager</h4>
    <p>Edit below, add or delete smiley code.<br />(when you allocate the code [;)] to a graphic, all instances of "[;)]" in your blogs will be replaced with that image)<br /></td></tr>
    <tr><td colspan="4"><hr><h4>Edit existing smileys</h4></td></tr>
    <tr><td><b>Code</td><td>Image</td><td>&nbsp;</td><td>&nbsp;</td></tr>
<%
    showsmileyedit
End Select
    adminform
    bottomadtable
End Sub

Sub showsmileyedit()
    blogfile = Server.MapPath("smileys.txt")
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objCountFile = objFSO.OpenTextFile(blogfile, 1, True)
    news = objCountFile.ReadAll
    objCountFile.Close
    Set objCountFile = Nothing   
    Set objFSO = Nothing
    smileycount=Split(news, "**")
    For i=1 to Ubound(smileycount)
        breakout=split(smileycount(i), "%%%")
        counter=breakout(0)
    %>
    <form action="<%=scriptname%>" method=post>
    <tr><td>
    <input type=hidden name="action" value="smileys">
    <input type=hidden name="method" value="edit">
    <input type=hidden name="id" value="<%=breakout(0)%>">
    <input type=text name="code" value="<%=breakout(1)%>" size="20"></td>
    <td><input type=text name="url" value="<%=breakout(2)%>" size="20"> <img src="<%=breakout(2)%>" /></td>
    <td><input type=submit class="buttons" value="Update"></td></form>
    <form action="<%=scriptname%>" method=post><input type=hidden name="action" value="smileys"><input type=hidden name="method" value="delete">
    <input type=hidden name="id" value="<%=breakout(0)%>"><td><input type=submit class="buttons" value="Delete"></td></tr></form>
<%
    Next
    %>
    <tr><td colspan="4"><hr><h4>Add a new smiley</h4></td></tr>
    <form action="<%=scriptname%>" method=post>
    <tr><td>
    <input type=hidden name="action" value="smileys">
    <input type=hidden name="method" value="new">
    <input type=hidden name="id" value="<%=Counter+1%>">
    <b>Code:</b> <input type=text name="code" size="20"></td>
    <td><b>Image path & filename:</b> <input type=text name="url" size="20"></td>
    <td colspan="2"><input type=submit class="buttons" value="Add this as a new smiley"></td></form></tr>
    </b>
    <%
End Sub

%>
Avatar billede medions Nybegynder
03. november 2002 - 18:12 #5
Har du en fil i den mappe hvor dette dokument ligger i der hedder myblogindex.txt?

//>Rune
Avatar billede stairway_to_heaven Nybegynder
03. november 2002 - 18:17 #6
jep det har jeg
Avatar billede medions Nybegynder
03. november 2002 - 18:29 #7
Hmm weird!

smileys.txt
easyblog.css
logindex.txt

Har du dem?

Og har du skriveadgang til den mappe hvor filerne oprettes/skrives til?

//>Rune
Avatar billede stairway_to_heaven Nybegynder
03. november 2002 - 18:45 #8
Har ikke logindex.txt men har myblog1.txt
Avatar billede medions Nybegynder
03. november 2002 - 18:54 #9
Så opret den...
Hvad står der i filen easyblogadmin.asp i linje 41?

//>Rune
Avatar billede stairway_to_heaven Nybegynder
03. november 2002 - 19:04 #10
Der står liikke noget på linje 41 men på linje 42 står der dette ' EasyBlogAsp - the easiest Blog and news script to set up in the world!
Avatar billede medions Nybegynder
03. november 2002 - 19:06 #11
lol ok.

Hm. Det lyder sq lidt underligt.. Hvis den melder fejl så må der sq være en fejl... Den plejer ik' at være upræcis!

//>Rune
Avatar billede stairway_to_heaven Nybegynder
03. november 2002 - 19:15 #12
oki det jeg har kopierewt den store tekst er filen easyblogadmin
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester