<?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>scriptygoddess &#187; Movable Type</title>
	<atom:link href="http://www.scriptygoddess.com/archives/category/movable-type/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.scriptygoddess.com</link>
	<description></description>
	<lastBuildDate>Thu, 08 Dec 2011 18:23:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Number of users currently online (part II)</title>
		<link>http://www.scriptygoddess.com/archives/2004/03/27/number-of-users-currently-online-part-ii/</link>
		<comments>http://www.scriptygoddess.com/archives/2004/03/27/number-of-users-currently-online-part-ii/#comments</comments>
		<pubDate>Sat, 27 Mar 2004 04:00:49 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[MT scripts]]></category>
		<category><![CDATA[WordPress scripts]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2004/03/27/number-of-users-currently-online-part-ii/</guid>
		<description><![CDATA[I&#039;ve been looking around for &#034;users currently online&#034; type scripts. So, tonight, I hacked together two great scripts. The first comes from Spoono &#8211; this script uses php and mySQL to keep track of how many users are on your site. Then tonight I saw Lynda&#039;s script &#8211; which uses php, a flat file and [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I&#039;ve been <a href="http://www.scriptygoddess.com/archives/004895.php">looking around</a> for &#034;users currently online&#034; type scripts. So, tonight, I hacked together two great scripts. The first comes from <a href="http://www.spoono.com/php/tutorials/tutorial.php?id=16">Spoono</a> &#8211; this script uses php and mySQL to keep track of how many users are on your site. Then tonight I saw <a href="http://www.soveryposh.com/blog/2004/03/online_users.php">Lynda&#039;s script</a> &#8211; which uses php, a flat file and makes use of MT&#039;s cookies to actually display WHO is on your site (they would have had to leave a comment on the site to show up in this list)</p>
<p>So I combined the two&#8230;<br />
<span id="more-658"></span><br />
(<b>IMPORTANT NOTE:</b> I&#039;m still working out the kinks with this script. If you use this and have issues &#8211; please email me (scripty aT scriptygoddess dOt nEt) &#8211; don&#039;t leave a comment&#8230; that way the comments section doesn&#039;t get out of hand&#8230; I&#039;d prefer to keep the comments section reversed for either modifications/alternate hacks or additional suggestions)</p>
<p>Here is the modified &#034;create table&#034; script</p>
<p><code>CREATE TABLE useronline (<br />
timestamp int(15) DEFAULT '0' NOT NULL,<br />
ip varchar(40) NOT NULL,<br />
file varchar(100) NOT NULL,<br />
userName varchar(50) NOT NULL,<br />
userURL varchar(100) NOT NULL,<br />
PRIMARY KEY (timestamp),<br />
KEY ip (ip),<br />
KEY file (file)<br />
);</code></p>
<p>The way the <a href="http://www.spoono.com/php/tutorials/tutorial.php?id=16">Spoono&#039;s original script</a> worked was that it would (I believe) only tell you how many users were on a <i>particular page</i> &#8211; but the way my script below works is that it shows users on the entire site&#8230;</p>
<p>On Lynda&#039;s site, she pointed out that you need to modify the &#034;rememberme&#034; and &#034;forgetme&#034; javascript functions. <a href="http://www.soveryposh.com/x/blog/online_users/">See her site for the details.</a></p>
<p>Now here&#039;s the updated script. (I made this a seperate file and put it on my site as an include where I wanted to the &#034;users on site&#034; to display)</p>
<p><code>&lt;?php<br />
//fill in some basic info<br />
$dbsvr= "localhost";<br />
$dbusrnam = "your-database-username";<br />
$dbpswrd = "your-database-password";<br />
$database = "your-database-name";<br />
$timeoutseconds = 300;<br />
$mt_name = isset($_COOKIE['mtcmtauth']) ? ($_COOKIE['mtcmtauth']) : "";<br />
$mt_url = isset($_COOKIE['mtcmthome']) ? ($_COOKIE['mtcmthome']) : "";<br />
$mt_ip = getenv("HTTP_X_FORWARDED_FOR") ? getenv("HTTP_X_FORWARDED_FOR") : getenv("REMOTE_ADDR");<br />
// If someone doesn't want their name to appear on the list, enter their<br />
// urls below, separated by a comma.  Example:<br />
// $blocked_urls = "http://www.domain1.com, http://www.domain2.com";<br />
$blocked_urls = "";<br />
// If user is in blocked report above, make them anonymous and then add to file<br />
if ($blocked_urls !="") {<br />
$blocked = explode(",", $blocked_urls);<br />
for ($i=0; $i &lt; count($blocked); $i++) {<br />
if (trim($blocked[$i]) == $mt_url) {<br />
$mt_name = "";<br />
$mt_url = "";<br />
}<br />
}<br />
}<br />
//get the time<br />
$timestamp = time();<br />
$timeout = $timestamp-$timeoutseconds;<br />
//connect to database<br />
mysql_connect($dbsvr, $dbusrnam, $dbpswrd);<br />
//insert the values<br />
$insert = mysql_db_query($database, "INSERT INTO useronline VALUES<br />
('$timestamp','$mt_ip ','','$mt_name','$mt_url');");<br />
if(!($insert)) {<br />
print "Useronline Insert Failed &gt; ";<br />
}<br />
//delete values when they leave<br />
$delete = mysql_db_query($database, "DELETE FROM useronline WHERE timestamp &lt; $timeout");<br />
if(!($delete)) {<br />
print "Useronline Delete Failed &gt; ";<br />
}<br />
//grab the results<br />
$result = mysql_db_query($database, "SELECT DISTINCT ip, userName, userURL FROM useronline");<br />
if(!($result)) {<br />
print "Useronline Select Error &gt; ";<br />
}<br />
//number of rows = the number of people online<br />
$user = mysql_num_rows($result);<br />
$display = "";<br />
$annon = 0;<br />
mysql_close();<br />
for ($i = 0; $i &lt; $user; $i++) {<br />
$row= mysql_fetch_array($result);<br />
if ($row["userName"] != "" &#038;&#038; $row["userURL"] != "") {<br />
//make sure url has "http://" in it<br />
$isHttpUrl = strpos($row["userURL"], "http://");<br />
if ($isHttpUrl === false) {<br />
    $row["userURL"] = "http://".$row["userURL"];<br />
}<br />
$display .= "&lt;a href=&#92;"".$row['userURL']."&#92;"&gt;".$row["userName"] ."&lt;/a&gt;&lt;br /&gt;";<br />
} else if ($row["userName"] != "") {<br />
$display .= $row["userName"] ."&lt;br /&gt;";<br />
} else {<br />
$annon++;<br />
}<br />
}<br />
if ($display != "") {<br />
echo $display;<br />
}<br />
if ($annon != "") {<br />
echo $annon;<br />
if ($annon &lt;= 1) {<br />
echo " user";<br />
} else {<br />
echo " users";<br />
}<br />
}<br />
?&gt;</code></p>
<p><b>To use this script with wordpress, change these two lines in the script above:</b></p>
<p><code>$mt_name = isset($_COOKIE['mtcmtauth']) ? ($_COOKIE['mtcmtauth']) : "";<br />
$mt_url = isset($_COOKIE['mtcmthome']) ? ($_COOKIE['mtcmthome']) : "";</code></p>
<p>To this:</p>
<p><code>$mt_name = (isset($_COOKIE['comment_author_'.$cookiehash])) ? trim($_COOKIE['comment_author_'.$cookiehash]) : '';<br />
$mt_url = (isset($_COOKIE['comment_author_url_'.$cookiehash])) ? trim($_COOKIE['comment_author_url_'.$cookiehash]) : '';</code></p>
<p>(yes, I know the variables still say &#034;mt&#034; in them &#8211; if that really confuses you, just do a find and replace and change them.</p>
<p>If you have MOVED OVER from MT to WP &#8211; and still want to capture the names of people who may or may not have left a comment on your wordpress blog yet (so they don&#039;t have cookies from wp comments &#8211; but probably still have MT cookies), change those lines to this instead:</p>
<p><code>$mt_name = (isset($_COOKIE['comment_author_'.$cookiehash])) ? trim($_COOKIE['comment_author_'.$cookiehash]) : '';<br />
if ($mt_name == '') {<br />
	$mt_name = isset($_COOKIE['mtcmtauth']) ? ($_COOKIE['mtcmtauth']) : "";<br />
}<br />
$mt_url = (isset($_COOKIE['comment_author_url_'.$cookiehash])) ? trim($_COOKIE['comment_author_url_'.$cookiehash]) : '';<br />
if ($mt_url == '') {<br />
	$mt_url = isset($_COOKIE['mtcmthome']) ? ($_COOKIE['mtcmthome']) : "";<br />
}</code></p>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2004/03/27/number-of-users-currently-online-part-ii/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>MT Paginate</title>
		<link>http://www.scriptygoddess.com/archives/2004/01/02/mt-paginate/</link>
		<comments>http://www.scriptygoddess.com/archives/2004/01/02/mt-paginate/#comments</comments>
		<pubDate>Sat, 03 Jan 2004 00:47:39 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[MT Plugins]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2004/01/02/mt-paginate/</guid>
		<description><![CDATA[MT Paginate: Just implemented this plugin on another (lesser known) site I run. Very easy &#8211; Very cool. I was easily able to take my category archives and paginate them so that one page wasn&#039;t loading tons and tons of entries (there was one category that was more &#034;top heavy&#034; than the others). The pagination [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.nonplus.net/software/mt/MTPaginate.htm">MT Paginate</a>: Just implemented this plugin on another (lesser known) site I run. Very easy &#8211; Very cool. I was easily able to take my category archives and paginate them so that one page wasn&#039;t loading tons and tons of entries (there was one category that was more &#034;top heavy&#034; than the others). The pagination won&#039;t show up unless the archive needs it. Very well done!!</p>
<p>[Found on <a href="http://mt-plugins.org/archives/entry/paginate.php">MT-Plugins.org</a>]<br />
<span id="more-1170"></span><br />
As requested, I&#039;ll give a little more info. Promise you won&#039;t laugh. I have a <a href="http://www.hipmonkey.com/justforfun/">Vin Diesel fan blog</a>. The &#034;misc.&#034; picture category was getting out of hand &#8211; so I wanted to paginate it so that all misc. photos wouldn&#039;t load up on the one page (there&#039;s ALOT of them&#8230; ok, you promised you wouldn&#039;t laugh!!) ;o)</p>
<p>First &#8211; to install the plugin &#8211; you need to upload it into your plugins folder (in your MT folder)</p>
<p>Here&#039;s what the main content on that template looks like (the MTPaginate tags are in bold)</p>
<h3>&lt;p align=&#034;center&#034;&gt;| &lt;a href=&#034;&lt;$MTBlogURL$&gt;&#034;&gt;Main&lt;/a&gt; |&lt;/p&gt;<br />
&lt;h1 align=&#034;center&#034;&gt;~~ &lt;$MTArchiveCategory$&gt; ~~&lt;/h1&gt;<br />
<b>&lt;MTPaginate&gt;<br />
&lt;!&#8211;The next part is what generates the &#034;page navigation&#034; &#8211;&gt;<br />
&lt;MTPaginateIfMultiplePages&gt;<br />
&lt;p&gt;&lt;$MTPaginateNavigator style=&#034;links&#034; format=&#034;%d&#034; $&gt;&lt;/p&gt;<br />
&lt;/MTPaginateIfMultiplePages&gt;<br />
&lt;!&#8211; This part determines how many posts will go on the page, I set it to 10 &#8211;&gt;<br />
&lt;MTPaginateContent max_sections=&#034;10&#034;&gt;<br /></b><br />
&lt;MTEntries&gt;<br />
&lt;$MTEntryTrackbackData$&gt;<br />
&lt;MTDateHeader&gt;<br />
&lt;h1&gt;&lt;$MTEntryDate format=&#034;%x&#034;$&gt;&lt;/h1&gt;<br />
&lt;/MTDateHeader&gt;<br />
&lt;div class=&#034;blogbody&#034;&gt;<br />
&lt;a name=&#034;&lt;$MTEntryID pad=&#034;1&#034;$&gt;&#034;&gt;&lt;/a&gt;<br />
&lt;p&gt;&lt;b&gt;&lt;$MTEntryTitle$&gt;&lt;/b&gt;&lt;/p&gt;<br />
&lt;$MTEntryBody$&gt;<br />
&lt;MTEntryIfExtended&gt;<br />
&lt;$MTEntryMore$&gt;<br />
&lt;/MTEntryIfExtended&gt;<br />
&lt;p&gt;<br />
&lt;a href=&#034;&lt;$MTEntryPermalink$&gt;&#034;&gt;&lt;$MTEntryDate format=&#034;%X&#034;$&gt;&lt;/a&gt;<br />
&lt;MTEntryIfAllowComments&gt;<br />
 | &lt;a href=&#034;&lt;$MTEntryPermalink$&gt;#comments&#034;&gt;Comments (&lt;$MTEntryCommentCount$&gt;)&lt;/a&gt;<br />
&lt;/MTEntryIfAllowComments&gt;<br />
&lt;MTEntryIfAllowPings&gt;<br />
 | &lt;a href=&#034;&lt;$MTCGIPath$&gt;&lt;$MTTrackbackScript$&gt;?__mode=view&amp;entry_id=&lt;$MTEntryID$&gt;&#034; onclick=&#034;OpenTrackback(this.href); return false&#034;&gt;TrackBack&lt;/a&gt;<br />
&lt;/MTEntryIfAllowPings&gt;<br />
&lt;/p&gt;<br />
<b>&lt;$MTPaginateSectionBreak$&gt; </b><br />
&lt;/MTEntries&gt;<br />
<b>&lt;/MTPaginateContent&gt;<br />
&lt;/MTPaginate&gt;</b></h3>
<p>A little more explanation of the page navigation tag:<br />
<b>&lt;$MTPaginateNavigator style=&#034;links&#034; format=&#034;%d&#034; $&gt;</b><br />
There can be other values for &#034;style&#034; and &#034;format&#034;. I have mine set to &#034;links&#034; because I wanted text links, instead of a pop-up menu. Format is how the text links are structred. I just wanted the numbers, but if you wanted it to display like: &#034;Page 1 | Page 2 | Page 3.. etc.&#034; the value of format would have been <b>&#034;Page %d&#034;</b></p>
<p>From what I could tell from the documentation, there are many other ways to use this. For example, if you have very long posts, you could paginate the content of a specific post (or at least that&#039;s what it looked like. I haven&#039;t tried it so I can&#039;t say for sure)</p>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2004/01/02/mt-paginate/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Updated Show/Hide script &#8211; (with additional links in the same line)</title>
		<link>http://www.scriptygoddess.com/archives/2003/12/30/updated-showhide-script-with-additional-links-in-the-same-line/</link>
		<comments>http://www.scriptygoddess.com/archives/2003/12/30/updated-showhide-script-with-additional-links-in-the-same-line/#comments</comments>
		<pubDate>Tue, 30 Dec 2003 16:19:08 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[MT Tips n Tricks]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2003/12/30/updated-showhide-script-with-additional-links-in-the-same-line/</guid>
		<description><![CDATA[Long title. Sorry. Someone wanted to use the show/hide comments script but have more than just the &#034;show comments&#034;/&#034;hide comments&#034; text in the same line. Basically &#8211; what they wanted was : Permalink &#124; Show Comments(3) &#124; Add Comment &#124; Trackback(2) Where the &#034;Show Comments&#034; would drop down and do the show/hide comments &#8211; and [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Long title. Sorry. <img src='http://www.scriptygoddess.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
Someone wanted to use the show/hide comments script but have more than just the &#034;show comments&#034;/&#034;hide comments&#034; text in the same line. Basically &#8211; what they wanted was :</p>
<p><b>Permalink | Show Comments(3) | Add Comment | Trackback(2)</b></p>
<p>Where the &#034;Show Comments&#034; would drop down and do the show/hide comments &#8211; and it would only be there IF there had been comments to display. (for this last part, to use this script, you need to be running PHP on your page)</p>
<p>I know this is a very particular case &#8211; but there&#039;s pieces in here you could probably cut, mix, and match.<br />
<span id="more-1168"></span><br />
First, you need to get the updated version of the show more comments script <a href="http://tweezersedge.com/archives/2003/11/000173.html">here</a>. (Side note: to Mr. Tweezer&#039;s complaint <strike>in his post about my not making it easier for him to use my scripts&#8230; I&#039;m sorry- I&#039;ll refund your money&#8230; oh wait &#8211; this site is <b>free</b> and actually here for my OWN PERSONAL reference&#8230; Sometimes I even drop code here without explanation &#8211; just so I can grab it later. The &#034;disclaimer&#034; in the sidebar also says <b>&#034;we are volunteers, not paid tech support. In the end, you&#039;re on your own.&#034;</b></strike> Seems he decided to take that part down. How nice.)</p>
<p>In any case instead of using the show more comments function I&#039;ve posted previously, use his revised one instead (function name changed to work seperately for comments):</p>
<h3>&lt;script type=&#034;text/javascript&#034;&gt;<br />
  function showMoreComments(entryID, entryLink, htmlObj) {<br />
    extTextDivID = (&#039;extText&#039; + (entryID));<br />
    extLinkDivID = (&#039;extLink&#039; + (entryID));<br />
    if( document.getElementById ) {<br />
      if( document.getElementById(extTextDivID).style.display ) {<br />
        if( entryLink != 0 ) {<br />
          document.getElementById(extTextDivID).style.display = &#034;block&#034;;<br />
          document.getElementById(extLinkDivID).style.display = &#034;none&#034;;<br />
          htmlObj.blur();<br />
        } else {<br />
          document.getElementById(extTextDivID).style.display = &#034;none&#034;;<br />
          document.getElementById(extLinkDivID).style.display = &#034;block&#034;;<br />
        }<br />
      } else {<br />
        location.href = entryLink;<br />
        return true;<br />
      }<br />
    } else {<br />
      location.href = entryLink;<br />
      return true;<br />
    }<br />
  }<br />
&lt;/script&gt;</h3>
<p>Now put this code below your entries in your template:</p>
<h3>&lt;div id=&#034;extLink&lt;$MTEntryID$&gt;&#034;&gt;<br />
&lt;a href=&#034;&lt;$MTEntryPermalink$&gt;&#034;&gt;Permalink&lt;/a&gt;<br />
&lt;MTEntryIfAllowComments&gt;<br />
&lt;?php if (&lt;$MTEntryCommentCount$&gt; &gt; 0) { ?&gt;<br />
 | &lt;a href=&#034;&lt;$MTEntryPermalink$&gt;&#034; name=&#034;ext&lt;$MTEntryID pad=&#034;1&#034;$&gt;&#034; onclick=&#034;showMoreComments(&lt;$MTEntryID$&gt;,&#039;&lt;$MTEntryPermalink$&gt;&#039;, this);return false;&#034;&gt;Show Comments (&lt;$MTEntryCommentCount$&gt;)&lt;/a&gt;<br />
&lt;?php } ?&gt;<br />
 | &lt;a href=&#034;&lt;$MTEntryPermalink$&gt;#comments&#034;&gt;Add your comment&lt;/a&gt;<br />
&lt;/MTEntryIfAllowComments&gt;<br />
&lt;MTEntryIfAllowPings&gt;<br />
 | &lt;a href=&#034;&lt;$MTCGIPath$&gt;&lt;$MTTrackbackScript$&gt;?__mode=view&#038;entry_id=&lt;$MTEntryID$&gt;&#034; onclick=&#034;OpenTrackback(this.href); return false&#034;&gt;TrackBack (&lt;$MTEntryTrackbackCount$&gt;)&lt;/a&gt;<br />
&lt;/MTEntryIfAllowPings&gt;<br />
&lt;/div&gt;<br />
&lt;div id=&#034;extText&lt;$MTEntryID$&gt;&#034; style=&#034;display: none&#034;&gt;<br />
&lt;a href=&#034;&lt;$MTEntryPermalink$&gt;&#034;&gt;Permalink&lt;/a&gt;<br />
&lt;MTEntryIfAllowComments&gt;<br />
 | &lt;a href=&#034;#ext&lt;$MTEntryID pad=&#034;1&#034;$&gt;&#034; onclick=&#034;showMoreComments(&lt;$MTEntryID$&gt;,0, this);return true;&#034;&gt;Hide Comments&lt;/a&gt;<br />
 | &lt;a href=&#034;&lt;$MTEntryPermalink$&gt;#comments&#034;&gt;Add your comment&lt;/a&gt;<br />
&lt;/MTEntryIfAllowComments&gt;<br />
&lt;MTEntryIfAllowPings&gt;<br />
 | &lt;a href=&#034;&lt;$MTCGIPath$&gt;&lt;$MTTrackbackScript$&gt;?__mode=view&#038;entry_id=&lt;$MTEntryID$&gt;&#034; onclick=&#034;OpenTrackback(this.href); return false&#034;&gt;<br />
TrackBack (&lt;$MTEntryTrackbackCount$&gt;)<br />
&lt;/a&gt;<br />
&lt;/MTEntryIfAllowPings&gt;<br />
&lt;MTEntryIfAllowComments&gt;<br />
&lt;MTComments&gt;<br />
&lt;$MTCommentBody$&gt;<br />
&lt;p&gt;Posted by &lt;$MTCommentAuthorLink show_email=&#034;0&#034;$&gt; at &lt;$MTCommentDate$&gt;&lt;/p&gt;&lt;br&gt;<br />
&lt;/MTComments&gt;<br />
&lt;/MTEntryIfAllowComments&gt;<br />
&lt;a href=&#034;&lt;$MTEntryPermalink$&gt;&#034;&gt;Permalink&lt;/a&gt;<br />
&lt;MTEntryIfAllowComments&gt;<br />
 | &lt;a href=&#034;#ext&lt;$MTEntryID pad=&#034;1&#034;$&gt;&#034; onclick=&#034;showMoreComments(&lt;$MTEntryID$&gt;,0, this);return true;&#034;&gt;Hide Comments&lt;/a&gt;<br />
 | &lt;a href=&#034;&lt;$MTEntryPermalink$&gt;#comments&#034;&gt;Add your comment&lt;/a&gt;<br />
&lt;/MTEntryIfAllowComments&gt;<br />
&lt;MTEntryIfAllowPings&gt;<br />
 | &lt;a href=&#034;&lt;$MTCGIPath$&gt;&lt;$MTTrackbackScript$&gt;?__mode=view&#038;entry_id=&lt;$MTEntryID$&gt;&#034; onclick=&#034;OpenTrackback(this.href); return false&#034;&gt;TrackBack (&lt;$MTEntryTrackbackCount$&gt;)&lt;/a&gt;<br />
&lt;/MTEntryIfAllowPings&gt;<br />
&lt;/div&gt;</h3>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2003/12/30/updated-showhide-script-with-additional-links-in-the-same-line/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Calendar modification</title>
		<link>http://www.scriptygoddess.com/archives/2003/12/28/calendar-modification/</link>
		<comments>http://www.scriptygoddess.com/archives/2003/12/28/calendar-modification/#comments</comments>
		<pubDate>Mon, 29 Dec 2003 01:24:11 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[MT Tips n Tricks]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2003/12/28/calendar-modification/</guid>
		<description><![CDATA[This is very basic &#8211; but I wanted to save the code somewhere. The default &#034;Calendar&#034; template has the dates linked to the last entry on that calendar day (mtpermalink) &#8211; but it would make more sense to have those links point to the DAILY ARCHIVE page (this assumes you have &#034;daily&#034; checked off as [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>This is <i>very</i> basic &#8211; but I wanted to save the code somewhere. The default &#034;Calendar&#034; template has the dates linked to the last entry on that calendar day (mtpermalink) &#8211; but it would make more sense to have those links point to the DAILY ARCHIVE page (this assumes you have &#034;daily&#034; checked off as one of your archiving types in your weblog settings/archiving)<br />
<span id="more-1164"></span><br />
Here&#039;s the whole thing, just so you have it for reference. I only changed the one line in bold:</p>
<h3>&lt;div align=&#034;center&#034; class=&#034;calendar&#034;&gt;<br />
&lt;table border=&#034;0&#034; cellspacing=&#034;4&#034; cellpadding=&#034;0&#034; summary=&#034;Monthly calendar with links to each day&#039;s posts&#034;&gt;<br />
&lt;caption class=&#034;calendarhead&#034;&gt;&lt;$MTDate format=&#034;%B %Y&#034;$&gt;&lt;/caption&gt;<br />
&lt;tr&gt;<br />
&lt;th abbr=&#034;Sunday&#034; align=&#034;center&#034;&gt;&lt;span class=&#034;calendar&#034;&gt;Sun&lt;/span&gt;&lt;/th&gt;<br />
&lt;th abbr=&#034;Monday&#034; align=&#034;center&#034;&gt;&lt;span class=&#034;calendar&#034;&gt;Mon&lt;/span&gt;&lt;/th&gt;<br />
&lt;th abbr=&#034;Tuesday&#034; align=&#034;center&#034;&gt;&lt;span class=&#034;calendar&#034;&gt;Tue&lt;/span&gt;&lt;/th&gt;<br />
&lt;th abbr=&#034;Wednesday&#034; align=&#034;center&#034;&gt;&lt;span class=&#034;calendar&#034;&gt;Wed&lt;/span&gt;&lt;/th&gt;<br />
&lt;th abbr=&#034;Thursday&#034; align=&#034;center&#034;&gt;&lt;span class=&#034;calendar&#034;&gt;Thu&lt;/span&gt;&lt;/th&gt;<br />
&lt;th abbr=&#034;Friday&#034; align=&#034;center&#034;&gt;&lt;span class=&#034;calendar&#034;&gt;Fri&lt;/span&gt;&lt;/th&gt;<br />
&lt;th abbr=&#034;Saturday&#034; align=&#034;center&#034;&gt;&lt;span class=&#034;calendar&#034;&gt;Sat&lt;/span&gt;&lt;/th&gt;<br />
&lt;/tr&gt;<br />
&lt;MTCalendar&gt;<br />
&lt;MTCalendarWeekHeader&gt;<br />
&lt;tr&gt;<br />
&lt;/MTCalendarWeekHeader&gt;<br />
&lt;td align=&#034;center&#034;&gt;&lt;span class=&#034;calendar&#034;&gt;<br />
&lt;MTCalendarIfEntries&gt;<br />
&lt;MTEntries lastn=&#034;1&#034;&gt;<br />
<b>&lt;a href=&#034;&lt;$MTEntryLink archive_type=&#034;Daily&#034;$&gt;&#034;&gt;</b><br />
&lt;$MTCalendarDay$&gt;<br />
&lt;/a&gt;<br />
&lt;/MTEntries&gt;<br />
&lt;/MTCalendarIfEntries&gt;<br />
&lt;MTCalendarIfNoEntries&gt;<br />
&lt;$MTCalendarDay$&gt;<br />
&lt;/MTCalendarIfNoEntries&gt;<br />
&lt;MTCalendarIfBlank&gt;<br />
&nbsp;<br />
&lt;/MTCalendarIfBlank&gt;<br />
&lt;/span&gt;<br />
&lt;/td&gt;<br />
&lt;MTCalendarWeekFooter&gt;<br />
&lt;/tr&gt;<br />
&lt;/MTCalendarWeekFooter&gt;<br />
&lt;/MTCalendar&gt;<br />
&lt;/table&gt;<br />
&lt;/div&gt;</h3>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2003/12/28/calendar-modification/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yearly Comment Leader Script</title>
		<link>http://www.scriptygoddess.com/archives/2003/12/23/yearly-comment-leader-script/</link>
		<comments>http://www.scriptygoddess.com/archives/2003/12/23/yearly-comment-leader-script/#comments</comments>
		<pubDate>Tue, 23 Dec 2003 14:52:42 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[MT hacks]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2003/12/23/yearly-comment-leader-script/</guid>
		<description><![CDATA[Guest authored by<br />
Jenni - <a href="http://www.bloggiebroad.com">bloggiebroad.com</a>
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I <a href="http://mt.addiebella.com/blog/archives/000817.php" target="_blank">just implemented</a> the comment leaderboard script available <a href="http://www.scriptygoddess.com/archives/003747.php" target="_blank">here</a>, but I wanted to feature the *yearly* comment leaders as opposed to the monthlies. I tinkered with it and lo and behold, it actually <i>worked</i>!<br />
<span id="more-1163"></span><br />
Replace the <b>bold</b> text with your own paths, e-mail address, author name, and blog id. You can adjust the number of leaders shown as well; the default is ten. You&#039;ll need the connect.php file in order for this script to work &#8212; info is available at <a href="http://www.thegirliematters.com/tips/archives/0301/comments_leader_board_with_php_and_mysql.php" target="_blank">The Girlie Matters</a>.</p>
<h3>&lt;? include (&#034;<b>/PATH/TO/YOUR/FILE/connect.php</b>&#034;);<br />
$leaders = mysql_query(&#034;SELECT comment_email, comment_url, comment_author, COUNT(*) as comment_count FROM mt_comment WHERE (comment_blog_id=<b>1</b>) AND (comment_email !=&#039;<b>E-MAIL ADDRESS YOU USE ON YOUR BLOG</b>&#039; AND comment_author !=&#039;<b>NAME YOU USE ON YOUR BLOG</b>&#039;) AND YEAR(comment_created_on) = YEAR(CURDATE()) GROUP BY comment_author, comment_email ORDER BY comment_count DESC LIMIT <b>10</b>&#034;);<br />
while($row = mysql_fetch_array($leaders)) {<br />
while (list($key,$val) = each($row)) {$$key = $val;}<br />
if (!empty($comment_url)) {<br />
$authorlink = &#034;&lt;a href=&#92;&#034;$comment_url&#92;&#034;&gt;$comment_author&lt;/a&gt;&#034;;<br />
} elseif(!empty($comment_email)) {<br />
$authorlink = &#034;&lt;a href=&#92;&#034;mailto:$comment_email&#92;&#034;&gt;$comment_author&lt;/a&gt;&#034;;<br />
} else {$authorlink = $comment_author;}<br />
echo &#034;$authorlink &#8212; $comment_count comments this year&lt;br /&gt;&#92;n&#034;;<br />
}<br />
?&gt;</h3>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2003/12/23/yearly-comment-leader-script/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Don&#039;t Be a Spammer!</title>
		<link>http://www.scriptygoddess.com/archives/2003/11/25/dont-be-a-spammer/</link>
		<comments>http://www.scriptygoddess.com/archives/2003/11/25/dont-be-a-spammer/#comments</comments>
		<pubDate>Wed, 26 Nov 2003 01:05:30 +0000</pubDate>
		<dc:creator>Christine</dc:creator>
				<category><![CDATA[MT hacks]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2003/11/25/dont-be-a-spammer/</guid>
		<description><![CDATA[Last weekend, I had to deal with almost 4,000 bounce messages that were sent &#034;from&#034; my domain. I blamed it on someone using my domain for the reply to address, but now I wonder if it wasn&#039;t a new version of spamming through MT. &#034;Mail This Entry&#034; used for spam &#8211; &#034;If you are using [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Last weekend, I had to deal with almost 4,000 bounce messages that were sent &#034;from&#034; my domain.  I blamed it on someone using my domain for the reply to address, but now I wonder if it wasn&#039;t a new version of spamming through MT.  <a title="[the girlie matters] tips and tricks: 'mail this entry' used for spam" href="http://www.thegirliematters.com/tips/archives/0311/mail_this_entry_used_for_spam.php">&#034;Mail This Entry&#034; used for spam</a> &#8211; &#034;If you are using Movable Type&#039;s &#034;Mail This Entry&#034; feature on your blog, you are advised to rename your mt-send-entry.cgi file, or remove the feature entirely.  If you are not using the feature on your blog, you still need to either rename the script, disable it by changing the permissions, or remove it from your server altogether.&#034;  Read all about it at <a href="http://www.thegirliematters.com/tips/archives/0311/mail_this_entry_used_for_spam.php">Girlie Matters<a>.</p>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2003/11/25/dont-be-a-spammer/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>MT-Blacklist 1.5 Released</title>
		<link>http://www.scriptygoddess.com/archives/2003/10/28/mt-blacklist-15-released/</link>
		<comments>http://www.scriptygoddess.com/archives/2003/10/28/mt-blacklist-15-released/#comments</comments>
		<pubDate>Tue, 28 Oct 2003 19:26:14 +0000</pubDate>
		<dc:creator>Christine</dc:creator>
				<category><![CDATA[MT Plugins]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2003/10/28/mt-blacklist-15-released/</guid>
		<description><![CDATA[Just released today &#8211; MT-Blacklist Version 1.5! Defend your blog! If you are using Adam Kalsey&#039;s comment notification hack, you might need to make some changes. See more details here. Other hacks and plugins may require additional tweaking, so remember &#8211; do a backup first! No related posts. Related posts brought to you by Yet [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Just released today &#8211; <a title="MT-Blacklist Version 1.5 released :: The Daily Journey :: JayAllen.org" href="http://www.jayallen.org/journey/2003/10/mtblacklist_version_15_released">MT-Blacklist Version 1.5</a>!  Defend your blog!</p>
<p>If you are using Adam Kalsey&#039;s <a href="http://www.kalsey.com/2002/08/comment_notification_hack/">comment notification hack</a>, you might need to make some changes.  See more details <a href="http://www.scriptygoddess.com/archives/004336.php#004336">here</a>.  Other hacks and plugins may require additional tweaking, so remember &#8211; do a backup first!</p>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2003/10/28/mt-blacklist-15-released/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Comment Notification Hack for MT-Blacklist</title>
		<link>http://www.scriptygoddess.com/archives/2003/10/15/comment-notification-hack-for-mt-blacklist/</link>
		<comments>http://www.scriptygoddess.com/archives/2003/10/15/comment-notification-hack-for-mt-blacklist/#comments</comments>
		<pubDate>Wed, 15 Oct 2003 19:09:36 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[MT hacks]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2003/10/15/comment-notification-hack-for-mt-blacklist/</guid>
		<description><![CDATA[Guest authored by<br />
Shawn Allison - <a href="http://www.shawnallison.com ">shawnallison.com</a>
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>On October 13th, the <a href="http://www.jayallen.org/misc/projects/mt-blacklist/">MT-Blacklist plugin</a> was released by Jay Allen. However, I found that the Blacklist.pm conflicts with the Adam Kalsey <a href="http://www.kalsey.com/2002/08/comment_notification_hack/">comment notification Hack</a>. </p>
<p>There is a simple way of fixing this small error if you do not want to receive e-mails of your comments. It worked for me but I can&#039;t guarantee it will work for you. If you try it, make sure you back up the original files you are modifying before attempting. I don&#039;t suggest this to novice MT users.<br />
<span id="more-1146"></span><br />
Open Blacklist.pm to line 2395 and you will see the following:</p>
<h3>MT::Mail->send(&#92;%head, $body);</h3>
<p>Place the following code in its place:</p>
<h3>MT::Mail->send(&#92;%head, $body) unless $author->email eq $comment->email;</h3>
<p>This will act the same as the Adam Kalsey Comment notification Hack as Patricia posted in reply to the original entry posted on the hack.</p>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2003/10/15/comment-notification-hack-for-mt-blacklist/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>More Meaningful Comment Notifications</title>
		<link>http://www.scriptygoddess.com/archives/2003/09/06/more-meaningful-comment-notifications/</link>
		<comments>http://www.scriptygoddess.com/archives/2003/09/06/more-meaningful-comment-notifications/#comments</comments>
		<pubDate>Sat, 06 Sep 2003 18:48:00 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[MT hacks]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2003/09/06/more-meaningful-comment-notifications/</guid>
		<description><![CDATA[Guest Authored by<br />
Promoguy - <a href="http://www.promoguy.net/">www.promoguy.net</a>
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I wanted to change how my blog comment notifications looked. Since I only have one blog, I don&#039;t need the first part to tell me which blog the comment is from. I also wanted to do whois lookups on the ipaddresses so I can get more info about the people who are commenting on my site.</p>
<p><span id="more-1126"></span></p>
<p>Here&#039;s what the original email looks like:</p>
<h3>Subj: <b>[PromoGuy dot Net] New Comment Posted to &#039;7 x 14 + 2 = 100 Things<br />
  Aboot Me&#039;<br />
  </b>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
  A new comment has been posted on your blog PromoGuy dot Net, on entry #1489<br />
  (7 x 14 + 2 = 100 Things Aboot Me).<br />
<u>http://www.promoguy.net/archives/001489.php</u><br />
IP Address: 123.45.678.90<br />
Name: Lisa<br />
Email Address: SomeMail@SomeDomain.net<br />
URL: <u>http://www.snarkypants.com</u></p>
<p>Comments:<br />
Hey! Where&#039;s the rest?? You promised! <img src='http://www.scriptygoddess.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Slackerboy!<br />
&#8211; </h3>
<p>After my modifications, my Comment Notifications look like this:</p>
<h3>Subj: <b>[7 x 14 + 2 = 100 Things Aboot Me] by &quot;Lisa&quot; &#8211; PromoGuy dot Net</b><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&quot;Lisa&quot; left a new comment in your blog PromoGuy dot Net, on entry #1489 (7 x<br />
14 + 2 = 100 Things Aboot Me).<br />
<u>http://www.promoguy.net/archives/001489.php</u><br />
IP Address: 123.45.678.90<br />
IP Info: <u>http://www.samspade.org/t/lookat?a=123.45.678.90</u><br />
Name: Lisa<br />
Email Address: SomeMail@SomeDomain.net<br />
URL: <u>http://www.snarkypants.com</u></p>
<p>Comments:<br />
Hey! Where&#039;s the rest?? You promised! <img src='http://www.scriptygoddess.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Slackerboy!<br />
&#8211; </h3>
<p>My changes reflect my preferences, yours may be different. </p>
<p>1. I don&#039;t need to see &quot;New Comment Posted to&quot; in my subject line. It takes<br />
up too much space, and my web mail program won&#039;t show full subject lines, so I<br />
need the important stuff first. Besides, by looking at the Brackets I recognize<br />
that it is a comment notification. </p>
<p>2. I want to know which post got the comment, so I put that first. I don&#039;t<br />
need to know which blog it is from, because I only have one &#8211; so I moved that<br />
part to the end. Plus, I wanted to know Who sent the comment. </p>
<p>3. On heavy comment days, my inbox is nearly bursting. Now when I see a<br />
comments is posted by a certain person, I can go to read that one first.</p>
<p>The only major change in the Body was making the IP Address into a clickable<br />
link to do a WHOIS and TRACEROUTE on SamSpade.com. I added a new line for that.<br />
I also slightly changed the wording on the first sentence. </p>
<p>Here is what I did. Again, once you see the changes I made, you will probably<br />
want to customize it the way you want it to look. <u>Please note: This code was<br />
tested and executed on MoveableType 2.64. </u>I don&#039;t know if it will work on<br />
lower versions, so YMMV.</p>
<p><b>Disclaimer: Do this at your own risk. It should go fine, but you never<br />
know. I won&#039;t be responsible for fixing it if you go and screw it up.</b></p>
<p>First, FTP or otherwise navigate to your MT installation directory and find:<br />
/lib/MT/App/</p>
<p>Now, make a backup copy of Comments.pm (always make backups, yo).</p>
<p>Open up Comments.pm in your favorite text editor (I use<br />
<a href="http://www.araneae.com/screenshots.html">araneae</a>; for simple jobs<br />
like this).</p>
<p>Go to Line 132 or search for &quot;$author-&gt;email&quot; (without the quotes) and you<br />
will be close.</p>
<p>Be sure you are on the line that says &quot;Subject =&gt;&quot; and we are ready to get<br />
jiggy!</p>
<p>Highlight and delete:</p>
<h3>Subject =&gt; &#039;[' . $blog-&gt;name . '] &#039; . $app-&gt;translate(&#039;New Comment Posted to &#92;&#039;[_1]&#92;&#034;, $entry-&gt;title));</h3>
<p>Replace it with:</p>
<h3>Subject =&gt; &#039;[' . $entry-&gt;title . '] &#039; . $app-&gt;translate(&#039;new comment by &#034;[_1]&#034; &#8211; [_2]&#039;, $comment-&gt;author, $blog-&gt;name)<br />
);</h3>
<p>Now if you want to Tweak the Body of the message, scroll down to about Line<br />
146.</p>
<p>I edited the body of the text to lead with the Comment Author&#039;s name. So<br />
change this:</p>
<h3>my $body = $app-&gt;translate(&#039;A new comment has been posted on your blog [_1], on entry #[_2] ([_3]).&#039;, $blog-&gt;name, $entry-&gt;id, $entry-&gt;title);</h3>
<p>To this:</p>
<h3>my $body = $app-&gt;translate(&#039;&#034;[_1]&#034; left a new comment in your blog [_2], on entry #[_3] ([_4]).&#039;, $comment-&gt;author, $blog-&gt;name, $entry-&gt;id, $entry-&gt;title,);</h3>
<p>If you want to investigate their IP address, put your cursor right under</p>
<h3>$app-&gt;translate(&#039;IP Address:&#039;) . &#039; &#039; . $comment-&gt;ip . &quot;&#92;n&quot; .</h3>
<p>and hit enter, making a blank line.</p>
<p>Now copy and paste this:</p>
<h3>$app-&gt;translate(&#039;IP Info: http://www.samspade.org/t/lookat?a=[_1]&#039;, $comment-&gt;ip) . &quot;&#92;n&quot; .</h3>
<p>Save the file, making sure it has the .pm extension. Save it back to the same<br />
directory, overwriting the current Comments.pm. (because you already have a<br />
backup, right?).</p>
<p>Now go leave yourself a comment. See how much more meaningful those Comment<br />
Notifications are? </p>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2003/09/06/more-meaningful-comment-notifications/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Author&#039;s RSS Feed field in comments</title>
		<link>http://www.scriptygoddess.com/archives/2003/06/12/authors-rss-feed-field-in-comments/</link>
		<comments>http://www.scriptygoddess.com/archives/2003/06/12/authors-rss-feed-field-in-comments/#comments</comments>
		<pubDate>Fri, 13 Jun 2003 03:27:00 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[MT hacks]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2003/06/12/authors-rss-feed-field-in-comments/</guid>
		<description><![CDATA[A while back Chris had asked about getting an extra field in the comments form. At the time all I could do was figure out a way to get the field emailed to you. But thanks to a few lessons I learned in the last script/MT-hack I wrote &#8211; I&#039;ve figured out how to do [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>A <a href="http://www.scriptygoddess.com/archives/003555.php">while back</a> <a href="http://chris.pirillo.com/archives/2003_03.html#004210">Chris</a> had asked about getting an extra field in the comments form. At the time all I could do was figure out a way to get the field emailed to you. But thanks to a few lessons I learned in the last script/MT-hack I wrote &#8211; I&#039;ve figured out how to do it all. So this is part MT-hack and part plugin.</p>
<p>Here&#039;s a summary of what this does:</p>
<p>You add a field in your comments form to collect RSS feed&#039;s from your commenters and then you can display it back in your comments on your site &#8211; just like you do with their blog-URL.</p>
<p>What&#039;s involved:</p>
<p>You&#039;ll be editing any template you use that displays comments or the comment form, and install a plugin (which is as simple as uploading a file to your site) As well, You&#039;ll need to edit two MT files and the mt-database. If you&#039;re not comfortable doing this &#8211; I suggest you set up a test MT install and play with this first.</p>
<p><a href="http://www.scriptygoddess.com/downloads/commentAuthorRSS.zip">Here is the download for the plugin</a>. The tags associated with the plugin will not work on their own &#8211; you&#039;ll need to follow all of the instructions (below).</p>
<p>Some credit notes: A MASSIVELY HUGE THANK YOU to <a href="http://www.milbertus.com/">&#034;Milbertus&#034; (A.) of milbertus.com</a> for writing the plugin for the MTCommentFeed tag (MTCommentPreviewFeed tags still in development at this time) (I wrote the plugin for the MTCommentIfRSS tag. w00t!)<br />
<span id="more-1084"></span><br />
<b>Part One: Edit your comments form</b></p>
<p>In your comments form, add this:</p>
<h3><font color="red"><b>Your RSS Feed: &lt;input type=&#034;text&#034; name=&#034;rssfeed&#034; /&gt;</b></font></h3>
<p>If you have the &#034;remember me&#034; cookies working on this page, and you&#039;d like this field to also be remembered, look for your &#034;remember me&#034; and &#034;forget me&#034; functions (towards the top of your page), and just add the line that I have in red/bold text:</p>
<h3>function rememberMe (f) {<br />
var now = new Date();<br />
fixDate(now);<br />
now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);<br />
setCookie(&#039;mtcmtauth&#039;, f.author.value, now, &#034;, HOST, &#034;);<br />
setCookie(&#039;mtcmtmail&#039;, f.email.value, now, &#034;, HOST, &#034;);<br />
setCookie(&#039;mtcmthome&#039;, f.url.value, now, &#034;, HOST, &#034;);<br />
<font color="red"><b>setCookie(&#039;mtcmtrssfeed&#039;, f.rssfeed.value, now, &#034;, HOST, &#034;);</b></font><br />
}<br />
function forgetMe (f) {<br />
deleteCookie(&#039;mtcmtmail&#039;, &#034;, HOST);<br />
deleteCookie(&#039;mtcmthome&#039;, &#034;, HOST);<br />
deleteCookie(&#039;mtcmtauth&#039;, &#034;, HOST);<br />
<font color="red"><b>deleteCookie(&#039;mtcmtrssfeed&#039;, &#034;, HOST);</b></font><br />
f.email.value = &#034;;<br />
f.author.value = &#034;;<br />
f.url.value = &#034;;<br />
<font color="red"><b>f.rssfeed.value =&#034;;</b></font><br />
}</h3>
<p>Now look towards the bottom for the page for the code below and add what I have in red/bold</p>
<h3>&lt;script type=&#034;text/javascript&#034; language=&#034;javascript&#034;&gt;<br />
&lt;!&#8211;<br />
document.comments.email.value = getCookie(&#034;mtcmtmail&#034;);<br />
document.comments.author.value = getCookie(&#034;mtcmtauth&#034;);<br />
document.comments.url.value = getCookie(&#034;mtcmthome&#034;);<br />
<font color="red"><b>document.comments.rssfeed.value = getCookie(&#034;mtcmtrssfeed&#034;);</b></font><br />
//&#8211;&gt;<br />
&lt;/script&gt;</h3>
<p>
<p><strong>Part Two: Getting the field into the MT database.</strong></p>
<p>You will need to run this SQL query. I suggest going into phpMyAdmin (if your<br />
  host provider has this). Click on the SQL tab, and paste the line below in the<br />
  field, and then click go.</p>
<h3>ALTER TABLE mt_comment ADD comment_author_rss VARCHAR( 255 ) ;</h3>
<p>
<p><b>Part Three: Edit Comments.pm</b></p>
<p>This is the part that has to be re-done each time you upgrade (or replace your comments.pm file). Your Comments.pm file should be located in this path: yourMTfolder/lib/MT/App/Comments.pm<br />
Look for this line (probably around line 82):</p>
<h3><i>$comment->author(remove_html(scalar $q->param(&#039;author&#039;)));</i></h3>
<p>and add these lines below it:</p>
<h3><font color="red">my $rssfeed = $q-&gt;param(&#039;rssfeed&#039;) || &#034;;<br />
if ($rssfeed) {<br />
require MT::Util;<br />
if (my $fixed2 = MT::Util::is_valid_url($rssfeed)) {<br />
$rssfeed = $fixed2;<br />
} else {<br />
return $app-&gt;handle_error($app-&gt;translate(<br />
&quot;Invalid URL &#039;[_1]&#039;&quot;, $rssfeed));<br />
}<br />
}<br />
$comment-&gt;author_rss(remove_html($rssfeed));</font></h3>
<p>Look for this line (probably around line 150):</p>
<h3><i>$app->translate(&#039;URL:&#039;) . &#039; &#039; . $comment->url . &#034;&#92;n&#92;n&#034; .</i></h3>
<p>and add this line below it:</p>
<h3><font color="red"><b>$app->translate(&#039;RSS Feed:&#039;) . &#039; &#039; . $comment->rssfeed. &#034;&#92;n&#92;n&#034; .</b></font></h3>
<p>
<p><strong>Part Four: Edit Comment.pm</strong></p>
<p>This will also need to be re-done each time you upgrade (or replace your Comment.pm file). Your Comment.pm file should be located in this path: YourMTFolder/lib/MT/Comment.pm<br />
Look for this line</p>
<h3><em>&#039;id&#039;, &#039;blog_id&#039;, &#039;entry_id&#039;, &#039;author&#039;, &#039;email&#039;, &#039;url&#039;, &#039;text&#039;, &#039;ip&#039;</em></h3>
<p>CHANGE it to (you&#039;re just adding the<strong> &#039;author_rss&#039;,</strong> in there:</p>
<h3> &#039;id&#039;, &#039;blog_id&#039;, &#039;entry_id&#039;, &#039;author&#039;, &#039;email&#039;, &#039;url&#039;, <font color="red"><strong>&#039;author_rss&#039;</strong></font>,<br />
  &#039;text&#039;, &#039;ip&#039;</h3>
<p>
<p><strong>Part Five: Using the Plugin:</strong></p>
<p>Here&#039;s an example of how the tags will work. This site uses this plugin and mt-hack, so you can see how it is displayed.</p>
<h3>&lt;MTCommentIfRSS&gt;<br />
  &lt;a href=&quot;&lt;$MTCommentFeed$&gt;&quot;&gt;My RSS Feed&lt;/a&gt;<br />
  &lt;/MTCommentIfRSS&gt;</h3>
<p>(MTCommentPreviewFeed example coming&#8230;)</p>
<p><strong>Part Six/Addendum: Comment Subscribe modification</strong></p>
<p>If you use &quot;subscribe to comments&quot; script, you&#039;ll also need to edit the processing.tmpl file that came with the script. Add this to the form on that page:</p>
<h3>&lt;input type=&quot;hidden&quot; name=&quot;rssfeed&quot; value=&quot;&lt;?<br />
echo $rssfeed ?&gt;&quot;&gt;</h3>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2003/06/12/authors-rss-feed-field-in-comments/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>

