Skip to content

Commit

Permalink
Added the ability to customize the image for the front page of the forum
Browse files Browse the repository at this point in the history
  • Loading branch information
newlisponrockets committed Jun 10, 2019
1 parent 0217e80 commit d1f1d14
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
7 changes: 7 additions & 0 deletions fileupload.lsp
Expand Up @@ -26,6 +26,13 @@
(save "Rockets-config.lisp" 'RocketsConfig)
))

; if we've updated the forum header image, change the image in the config file
(if ($GET "updatediscussion") (begin
(displayln "<p>Updating discussion image with: " file-name)
(setq RocketsConfig:DiscussionImage file-name)
(save "Rockets-config.lisp" 'RocketsConfig)
))

(displayln "<p>==================</p>")
; if we've updated a blog post with an image, update the body with an <img> link to that new image
(if ($GET "updateblogpost") (begin
Expand Down
12 changes: 10 additions & 2 deletions rockets-admin.lsp
Expand Up @@ -125,7 +125,15 @@
(displayln "<img src='images/" RocketsConfig:HeaderImage "' width=300 height=200>")
(displayln "Default image"))
(displayln "<form name='FileUpload' action='fileupload.lsp?updateheader=yes' method='POST' enctype='multipart/form-data'><input type='file' id='uploadName' name='uploaded_data' onChange='this.form.textname.value = this.value'><input type='hidden' name='textname'><input type='hidden' name='updateheaderimage' value='yes'><input type='submit' value='Upload' name='submit'></form>")


; add form for uploading a discussion image for the blog
(displayln "<p>Discussion header image:")
(if RocketsConfig:DiscussionImage
(displayln "<img src='images/" RocketsConfig:DiscussionImage "' width=300 height=200>")
(displayln "Default image"))
(displayln "<form name='FileUpload2' action='fileupload.lsp?updatediscussion=yes' method='POST' enctype='multipart/form-data'><input type='file' id='uploadName' name='uploaded_data' onChange='this.form.textname.value = this.value'><input type='hidden' name='textname'><input type='hidden' name='updatediscussionimage' value='yes'><input type='submit' value='Upload' name='submit'></form>")


; if we've made changes to any items, save them.
(if ($POST) (begin
; check to see if name has changed
Expand Down Expand Up @@ -301,7 +309,7 @@
; if we made changes and updated the page, show success
(if ($GET "updated") (display-success "Settings updated."))
(displayln "<p><i>Note: To create a podcast feed, you must first configure the options here, then add podcast posts to your blog with the same tag and with the 'Podcast' post type.</i></p>")
(setq default-podcast-settings '("Podcast Tag" "Podcast Title" "Podcast Copyright" "Podcast Subtitle" "Podcast Author" "Podcast Summary" "Podcast Owner" "Podcast Email" "Podcast Image" "Podcast Category" "Podcast Subcategory"))
(setq default-podcast-settings '("podcast" "Podcast Title" "Podcast Copyright" "Podcast Subtitle" "Podcast Author" "Podcast Summary" "Podcast Owner" "Podcast Email" "Podcast Image" "Podcast Category" "Podcast Subcategory"))
(if (nil? RocketsConfig:PodcastList) (setq RocketsConfig:PodcastList (list default-podcast-settings))) ; default options
(displayln "<p><form name='podcastadmin' method='POST'>")
(dolist (x RocketsConfig:PodcastList)
Expand Down
5 changes: 4 additions & 1 deletion rockets-forum.lsp
Expand Up @@ -18,7 +18,10 @@
(display-partial "rockets-navbar") ; shows the navigation bar with Rockets blog menus

(start-div "hero-unit")
(display-image "newlisp-rockets-picture-small" 480 270)
(if RocketsConfig:DiscussionImage
(display-image RocketsConfig:DiscussionImage)
(display-image "newlisp-rockets-picture-small" 480 270)
)
(displayln "<h2>The " RocketsConfig:ShortName " Discussion Forum</h2>")
(displayln "<P>Currently running newLISP on Rockets version: " $ROCKETS_VERSION "</p>")
(end-div)
Expand Down

0 comments on commit d1f1d14

Please sign in to comment.