<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CMS tutorial site &#187; PHP-Nuke</title>
	<atom:link href="http://blog.cmstutorials.org/posts/category/phpnuke/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.cmstutorials.org</link>
	<description>Free tutorials and resources</description>
	<lastBuildDate>Fri, 04 Jun 2010 22:39:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Flash login (for nuke systems)</title>
		<link>http://blog.cmstutorials.org/posts/tutorials/flash-login-for-nuke-systems</link>
		<comments>http://blog.cmstutorials.org/posts/tutorials/flash-login-for-nuke-systems#comments</comments>
		<pubDate>Fri, 13 Mar 2009 12:16:57 +0000</pubDate>
		<dc:creator>krike</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Nuke evolution]]></category>
		<category><![CDATA[PHP-Nuke]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.cmstutorials.org/?p=101</guid>
		<description><![CDATA[[video]

[written]
If you don&#8217;t want to spend to much time you can open the &#8220;login_source.fla&#8221; file in the download package and copy paste the textareas and the code.
(but you still need to add the php code, see step 14 if you use phpnuke or step 15 if you use nuke evolution).
1) Got to file-&#62; new and [...]]]></description>
			<content:encoded><![CDATA[<h2>[video]</h2>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="642" height="482" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://blog.cmstutorials.org/images/cmstut/tips/flashlogin/flashlogin.swf" /><embed type="application/x-shockwave-flash" width="642" height="482" src="http://blog.cmstutorials.org/images/cmstut/tips/flashlogin/flashlogin.swf"></embed></object></p>
<h2>[written]</h2>
<p>If you don&#8217;t want to spend to much time you can open the &#8220;login_source.fla&#8221; file in the download package and copy paste the textareas and the code.<br />
(but you still need to add the php code, see step 14 if you use phpnuke or step 15 if you use nuke evolution).</p>
<p class="entryp">1) Got to file-&gt; new and choose Flash File (ActionScript 2.0):</p>
<p><img src="http://blog.cmstutorials.org/images/cmstut/flashtut/flash%20login/screenshots/new_document.gif" alt="new document" width="500" height="325" /></p>
<p class="entryp">2) Go to file-&gt;import-&gt;import to library, and import image header_11_normal.gif</p>
<p><img src="http://blog.cmstutorials.org/images/cmstut/flashtut/flash%20login/screenshots/import_images.gif" alt="import images" width="500" height="382" /></p>
<p class="entryp">3) Move header_11_normal.gif to the stage, also take note of the widht and height (378.0 * 46.0) cause the document should have exact the same size as your image:</p>
<p><img src="http://blog.cmstutorials.org/images/cmstut/flashtut/flash%20login/screenshots/header11_width&amp;height.gif" alt="header to stage" width="500" height="215" /></p>
<p class="entryp">4) Deselect header_11_normal.gif (just click outside of the document), then click on the size button (see image below, 550*400). A new window should appear, replace the default size of the document with the size of header_11_normal.gif (width: 378.0, height: 46.0).</p>
<p><img src="http://blog.cmstutorials.org/images/cmstut/flashtut/flash%20login/screenshots/document_width&amp;height.gif" alt="set width height" width="382" height="350" /></p>
<p class="entryp">5) Select header image again and set the x and y to 0, this will align the header image perfectly with the document (will be placed on the white part of the document which is the document background, the stage).</p>
<p><img src="http://blog.cmstutorials.org/images/cmstut/flashtut/flash%20login/screenshots/header_xy.gif" alt="set xy for header" width="500" height="277" /></p>
<p class="entryp">6) Take your text tool (T) draw a text area on the header_11_image.gif and put following settings in the properties: (don&#8217;t forget to put username as variable, see var: username, It&#8217;s important !)</p>
<p><img src="http://blog.cmstutorials.org/images/cmstut/flashtut/flash%20login/screenshots/username.gif" alt="username" width="499" height="193" /></p>
<p class="entryp">7) Make a copy of that textarea and move it to the right, where a user has to type his password. But don&#8217;t forget to change the settings (change the variable name to user_password, and change single line to password, see image below):</p>
<p><img src="http://blog.cmstutorials.org/images/cmstut/flashtut/flash%20login/screenshots/user_password.gif" alt="user password" width="501" height="227" /></p>
<p class="entryp">8) Now make a third copy of the textarea and move it outside the document area (it&#8217;s important but a user should not see it). change the settings as follow: (change type of text to &#8220;Dynamic text&#8221;, change back to singe line and type &#8220;op&#8221; as var.)</p>
<p><img src="http://blog.cmstutorials.org/images/cmstut/flashtut/flash%20login/screenshots/login_op.gif" alt="login_op" width="501" height="227" /></p>
<p class="entryp">
<p>9) Now move the login.png to the stage, between the 2 textareas. Then rightmouse click on the login.png on the stage and choose &#8220;convert to button&#8221;:</p>
<p><img src="http://blog.cmstutorials.org/images/cmstut/flashtut/flash%20login/screenshots/convert_to_button.gif" alt="convert to button" width="501" height="304" /></p>
<p class="entryp">10) Be sure the loginbutton is selected, press F9 and add following actionscript:</p>
<p><img src="http://blog.cmstutorials.org/images/cmstut/flashtut/flash%20login/screenshots/actionscript.gif" alt="actionscript" width="500" height="255" /></p>
<p class="entryp">11) Now go to file-&gt;publish settings, when the new window is open click publish (it will save the .swf file and .html file in the same map where you saved you .fla file, if the .fla file was not saved yet flash will ask you to save it first).</p>
<p><img src="http://blog.cmstutorials.org/images/cmstut/flashtut/flash%20login/screenshots/publish_settings.gif" alt="publish settings" width="436" height="631" /></p>
<p class="entryp">12) Copy/paste the .swf file into the images map of your theme (theme/yourtheme/images)</p>
<p class="entryp">13) Open the html file in you editor and search after &lt;embed&#8230;./&gt; tag (on line 47, next to the parameter tags). Copy the entire embed tag.<br />
<img src="http://blog.cmstutorials.org/images/cmstut/flashtut/flash%20login/screenshots/embed_tag.gif" alt="embed tag" width="500" height="38" /></p>
<p class="entryp">
<h1><span style="text-decoration: underline;">IF-LUS:</span></h1>
<p>Now we are going to edit the header.php with some php code, basicly the if lus will be as follow: <strong><span style="text-decoration: underline;">pseudocode:</span></strong> <strong>IF</strong> user is logged in <strong>THEN</strong> Show welcome message <strong>ELSE</strong> Show flash login OR <strong>IF</strong> user is not logged in <strong>THEN</strong> show flash login <strong>ELSE</strong> show welcome message</p>
<p>[tab:Instruction for PHP-Nuke]</p>
<h2><strong><span style="text-decoration: underline;">14) PHP-Nuke</span></strong></h2>
<p>1) Open your header.php and find the line of the login image</p>
<p class="entryp">2)<strong> replace</strong></p>
<pre class="brush: c-sharp;">&gt;&lt;img src</pre>
<p class="entryp">3) <strong>with:</strong></p>
<pre class="brush: c-sharp;">background</pre>
<p class="entryp">4) before<strong> &lt;/td&gt;</strong> add:</p>
<pre class="brush: c-sharp;">&lt;center&gt;Welcome $username || &lt;a href="modules.php?name=Private_Messages"&gt;$newpms&lt;/a&gt; New PM's&lt;/center&gt;</pre>
<p class="entryp">5) make sure that line is between echo tags <span style="color: #ff0000;">echo&#8221; &#8230;image line&#8230;&#8221;;</span></p>
<p class="entryp">6) at the end of the previous line of the login image line (after &lt;/td&gt;) add:</p>
<pre class="brush: c-sharp;">";</pre>
<p class="entryp">7) before the next line of the login image line (before &lt;td&#8230;.&gt;) add:</p>
<pre class="brush: c-sharp;">echo"</pre>
<p class="entryp">8) before the line of the login image (before echo&#8221;&lt;td&#8230;.&gt;) add:</p>
<pre class="brush: c-sharp;">if ($username == "" || $username == "Anonymous" ) {
//add login line here (embed tag)
}
else
{
//add welcome message here
}</pre>
<p class="entryp">9) Cut the entire line of the login image (echo&#8221;&lt;td&#8230;&#8221;;) and replace &#8220;//add welcome message here&#8221; with the login image line you&#8217;ve cut.</p>
<p class="entryp">10) replace &#8220;//add login line here (embed tag)&#8221; with the embed tag of the flash login. note*: the embed tag must be between the same td tags as the normal image line of the login. <strong><span style="text-decoration: underline;">example:</span></strong></p>
<pre class="brush: c-sharp;">if ($username == "" || $username == "Anonymous" ) {
echo "<strong>&lt;td colspan="2" rowspan="3"&gt;</strong>&lt;embed tag........./&gt;<strong>&lt;/td&gt;</strong>";
}
else
{
echo "<strong>&lt;td colspan="2" rowspan="3"</strong> background="themes/yourtheme/images/header_13.gif" width="270" height="33" alt=""&gt;&lt;center&gt;Welcome $username || &lt;a href="modules.php?name=Private_Messages"&gt;$newpms&lt;/a&gt; New PM's&lt;/center&gt;<strong>&lt;/td&gt;</strong>";
}</pre>
<p class="entryp">11) in the embed tag find the source (src=&#8221;login.swf&#8221;) and before the flash name add the new path -&gt; src=&#8221;themes/yourtheme/images/login.swf&#8221;</p>
<p class="entryp">[tab:Instruction for Nuke evolution]</p>
<h2><strong><span style="text-decoration: underline;">15) Nuke evolution</span></strong></h2>
<p>1) Open your header.php</p>
<p class="entryp">2) in the header add:</p>
<pre class="brush: c-sharp;">include_once(NUKE_MODULES_DIR .'Evo_UserBlock/addons/username.php');
global $evouserinfo_username;</pre>
<p class="entryp">3)find the line of the login image, <strong>replace</strong></p>
<pre class="brush: c-sharp;">&gt;&lt;img src</pre>
<p class="entryp">4) <strong>with:</strong></p>
<pre class="brush: c-sharp;">background</pre>
<p class="entryp">5) before<strong> &lt;/td&gt;</strong> add:</p>
<pre class="brush: c-sharp;">&lt;center&gt;Welcome $evouserinfo_username [&lt;a href='modules.php?name=Your_Account&amp;op=logout'&gt;logout&lt;/a&gt;]&lt;/center&gt;</pre>
<p class="entryp">6) make sure that line is between echo tags (echo&#8221; &#8230;image line&#8230;&#8221;;)</p>
<p class="entryp">7) at the end of the previous line of the login image line (after &lt;/td&gt;) add:</p>
<pre class="brush: c-sharp;">";</pre>
<p class="entryp">8) before the next line of the login image line (before &lt;td&#8230;.&gt;) add:</p>
<pre class="brush: c-sharp;">echo"</pre>
<p class="entryp">9) before the line of the login image (before echo&#8221;&lt;td&#8230;.&gt;) add:</p>
<pre class="brush: c-sharp;">if (is_user() ) {
//add welcome message here
}
else
{
//add login line here (embed tag)
}</pre>
<p class="entryp">10) Cut the entire line of the login image (echo&#8221;&lt;td&#8230;&#8221;;) and replace &#8220;//add welcome message here&#8221; with the login image line you&#8217;ve cut.</p>
<p class="entryp">11) replace &#8220;//add login line here (embed tag)&#8221; with the embed tag of the flash login. note*: the embed tag must be between the same td tags as the normal image line of the login. <strong><span style="text-decoration: underline;">example:</span></strong></p>
<pre class="brush: c-sharp;">if (is_user() ) {
echo "<strong>&lt;td</strong> background='themes/yourtheme/images/header_11.gif' width='378' height='46' alt=''&gt;&lt;center&gt;Welcome $evouserinfo_username [&lt;a href='modules.php?name=Your_Account&amp;op=logout'&gt;logout&lt;/a&gt;]&lt;/center&gt;<strong>&lt;/td&gt;</strong>";
}
else
{
echo "<strong>&lt;td &gt;</strong>&lt;embed tag ..../&gt;<strong>&lt;/td&gt;</strong>";
}</pre>
<p class="entryp">12) in the embed tag find the source (src=&#8221;login.swf&#8221;) and before the flash name add the new path -&gt; src=&#8221;themes/yourtheme/images/login.swf&#8221;</p>
<p class="entryp">[tab:END]</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cmstutorials.org/posts/tutorials/flash-login-for-nuke-systems/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
