This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfsilent> | |
<!---Flickr Params---> | |
<cfparam name="flickr" default="http://www.flickr.com/services/rest/" /> | |
<cfparam name="key" default="Your API Key Here" /> | |
<cfparam name="userid" default="Your User ID Here"> | |
<!---url.reinit used to manually refresh--> | |
<cfparam name="url.reinit" default=""> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfoutput> | |
<h2>Photos</h2> | |
<!--XML last cached #application.FlickrXmlstarted#---> | |
<cfloop from="1" to="#ArrayLen(photosets)#" index="i"> | |
<cfoutput> | |
<div id="photoset" class="clear"> | |
<!---Output primary image---> | |
<img class="left" src="http://farm#photosets[i].XmlAttributes['farm']#.static.flickr.com/#photosets[i].XmlAttributes['server']#/#photosets[i].XmlAttributes['primary']#_#photosets[i].XmlAttributes['secret']#_s.jpg"> | |
<!---output title---> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************************* | |
FORMS | |
Notes: Add this predefined values to your /config/settings.cfm file: | |
Then, just make sure you add #startFormTag(class="generic")# to any form you want this CSS applied to. | |
<cfscript> | |
// Form Field Defaults | |
set(functionName="textField,textFieldTag,textArea,textAreaTag,passwordField,passwordFieldTag,select,selectTag,fileField,fileFieldTag", | |
prependToLabel="<div class='field'>", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfset thePassword='myPassword1'> | |
<cfset passwordHash=Hash(thePassword, 'SHA-512') /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfset salt=createUUID() /> | |
<cfset passwordHash=Hash(thePassword & salt, 'SHA-512') /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!---Get the key---> | |
<cfset authKeyLocation=expandpath('../auth/key.txt')> | |
<cffile action="read" file="#authKeyLocation#" variable="authkey"> | |
<!--- New password hashing ---> | |
<!--- Generate a salt, this is never stored in it's plain form---> | |
<cfset theSalt=createUUID() /> | |
<!--- Hash the password with the salt in it's plain form---> | |
<cfset passwordHash=Hash(thePassword & theSalt, 'SHA-512') /> | |
<!--- The encrypted salt to store in the database, using the authKey---> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#truncate( | |
text=stripTags(body), | |
length=300, | |
truncateString="#linkTo( | |
text='... Read More »', | |
route='blog', | |
action='view', | |
key=id)#" | |
)# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<--------Main.cfc-----------> | |
<cffunction name="init"> | |
<cfscript> | |
// AD Auth, application wide: if I wanted to only restrict a subset a pages, I could use 'only' instead of except below. | |
// This filter call should be in every controller you wish to protect | |
filters(through="loginRequired", except="login,dologin"); | |
// Login | |
verifies(only="dologin", post=true, params="username,password", error="Both username and password are required", handler="login"); | |
</cfscript> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This gets the latest posts from your PHPBB3 install and outputs them as a UL; results are limited to forum.id's 1,2 and 3 in this example; | |
$connection = mysql_connect(localhost,"YOURDATABASEUSER","YOURDATABASEPW") or die("Service Currently Unavailable"); | |
$db = mysql_select_db("YOURPHPBB3DATABASENAME",$connection) or die("Service Currently Unavailable"); | |
$sql = "SELECT `phpbb_topics`.`forum_id`, `phpbb_topics`.`topic_id`, `phpbb_topics`.`topic_title`, `phpbb_forums`.`forum_id`, `phpbb_forums`.`forum_name`,`phpbb_forums`.`parent_id` FROM `phpbb_topics` | |
Inner Join `phpbb_forums` ON `phpbb_forums`.`forum_id` = `phpbb_topics`.`forum_id` WHERE `phpbb_forums`.`parent_id` = 1 OR `phpbb_forums`.`parent_id` = 2 OR `phpbb_forums`.`parent_id` = 2 | |
order by topic_last_post_time desc limit 0,10"; | |
$result = mysql_query($sql) or die("Service Currently Unavailable"); | |
echo "<ul>"; | |
for($x=1;$x<=10;$x++){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<--- edit.cfm // NB, boostrapDateSelect() is using that bootstrap plugin I did---> | |
<cfparam name="Signpost"> | |
<cfparam name="allCategories"> | |
<cfoutput> | |
<cfif params.action EQ "edit"> | |
<h1>Edit Signpost</h1> | |
<p>#linkTo(text="View Signpost", route="Signposts", action="view", key=Signpost.key(), class="btn btn-primary")#</p> | |
#startFormTag(action="update", route='admin', controller='Signposts')# #hiddenField(objectname="Signpost", property="id")# | |
<cfelse> | |
<h1>Add New Signpost</h1> |