<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki-dev.creativecommons.org/index.php?action=history&amp;feed=atom&amp;title=Cchost%2Fdeveloper%2FReverse_Engineering</id>
	<title>Cchost/developer/Reverse Engineering - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki-dev.creativecommons.org/index.php?action=history&amp;feed=atom&amp;title=Cchost%2Fdeveloper%2FReverse_Engineering"/>
	<link rel="alternate" type="text/html" href="https://wiki-dev.creativecommons.org/index.php?title=Cchost/developer/Reverse_Engineering&amp;action=history"/>
	<updated>2026-10-01T05:46:49Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://wiki-dev.creativecommons.org/index.php?title=Cchost/developer/Reverse_Engineering&amp;diff=19945&amp;oldid=prev</id>
		<title>Fourstones: /* A ccHost Quick Reverse Engineer */</title>
		<link rel="alternate" type="text/html" href="https://wiki-dev.creativecommons.org/index.php?title=Cchost/developer/Reverse_Engineering&amp;diff=19945&amp;oldid=prev"/>
		<updated>2008-11-17T23:10:53Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;A ccHost Quick Reverse Engineer&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:10, 17 November 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l26&quot;&gt;Line 26:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 26:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;**the menu itself is embedded in the &amp;#039;R&amp;#039; record&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;**the menu itself is embedded in the &amp;#039;R&amp;#039; record&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;**a few lines above is line &amp;#039;&amp;#039;&amp;#039;%map(#R,records/0)%&amp;#039;&amp;#039;&amp;#039; which means &amp;#039;R&amp;#039; is result of the query (&amp;#039;records&amp;#039; is the array of a query result in a template)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;**a few lines above is line &amp;#039;&amp;#039;&amp;#039;%map(#R,records/0)%&amp;#039;&amp;#039;&amp;#039; which means &amp;#039;R&amp;#039; is result of the query (&amp;#039;records&amp;#039; is the array of a query result in a template)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;**every query must have a dataview somewhere, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sure enough &lt;/del&gt;at the top of the template  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;**every query must have a dataview somewhere, at the top of the template &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;is the meta declaration &lt;/ins&gt;&#039;&#039;&#039;dataview = playlist_detail&#039;&#039;&#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; to display this playlist, &lt;/del&gt;&#039;&#039;&#039;dataview = playlist_detail&#039;&#039;&#039;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*I found &amp;#039;&amp;#039;&amp;#039;ccdataviews/playlist_detail.php&amp;#039;&amp;#039;&amp;#039;  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*I found &amp;#039;&amp;#039;&amp;#039;ccdataviews/playlist_detail.php&amp;#039;&amp;#039;&amp;#039;  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Since the &#039;menu&#039; is a PHP array and not a normal SQL column, I deduced there must a dataview filter that is building the menu&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Since the &#039;menu&#039; is a PHP array and not a normal SQL column, I deduced there must a dataview filter that is building the menu&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Filter events are returned in an array in a dataview and there was &amp;#039;&amp;#039;CC_EVENT_FILTER_CART_MENU&amp;#039;&amp;#039; (a playlist is actually a record in the &amp;#039;&amp;#039;cc_tbl_carts&amp;#039;&amp;#039; table)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Filter events are returned in an array in a dataview and there was &amp;#039;&amp;#039;CC_EVENT_FILTER_CART_MENU&amp;#039;&amp;#039; (a playlist is actually a record in the &amp;#039;&amp;#039;cc_tbl_carts&amp;#039;&amp;#039; table)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*I searched &amp;#039;&amp;#039;&amp;#039;cchost_lib/*&amp;#039;&amp;#039;&amp;#039; for that event and found the declaration of a handler in &amp;#039;&amp;#039;&amp;#039;cchost_lib/ccextras/cc-playlist.php&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*I searched &amp;#039;&amp;#039;&amp;#039;cchost_lib/*&amp;#039;&amp;#039;&amp;#039; for that event and found the declaration of a handler in &amp;#039;&amp;#039;&amp;#039;cchost_lib/ccextras/cc-playlist.php&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Fourstones</name></author>
	</entry>
	<entry>
		<id>https://wiki-dev.creativecommons.org/index.php?title=Cchost/developer/Reverse_Engineering&amp;diff=19944&amp;oldid=prev</id>
		<title>Fourstones: /* A ccHost Quick Reverse Engineer */</title>
		<link rel="alternate" type="text/html" href="https://wiki-dev.creativecommons.org/index.php?title=Cchost/developer/Reverse_Engineering&amp;diff=19944&amp;oldid=prev"/>
		<updated>2008-11-17T23:09:25Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;A ccHost Quick Reverse Engineer&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:09, 17 November 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l3&quot;&gt;Line 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;When I sat down to write the [[Cchost/developer/tutorial/Featured_Playlist|auto &amp;#039;feature this playlist&amp;#039;]] feature I knew I wanted to add a menu item to the playlist&amp;#039;s command window but I totally forgot how that menu was generated. It took less than a minute to figure it out but I thought it might be useful since I know this kind of &amp;#039;view source/reverse engineer&amp;#039; is how most developers approach a codebase like ccHost.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;When I sat down to write the [[Cchost/developer/tutorial/Featured_Playlist|auto &amp;#039;feature this playlist&amp;#039;]] feature I knew I wanted to add a menu item to the playlist&amp;#039;s command window but I totally forgot how that menu was generated. It took less than a minute to figure it out but I thought it might be useful since I know this kind of &amp;#039;view source/reverse engineer&amp;#039; is how most developers approach a codebase like ccHost.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Firefox has a &#039;Web Developer Toolbar&#039; that I find invaluable. &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*I [http://ccmixter.org/playlist/browse/10 browsed to a playlist].  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*I [http://ccmixter.org/playlist/browse/10 browsed to a playlist].  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Selected &#039;View Style Information&#039; from Firefox&#039;s Web Developer Toolbar which highlights the area under the cursor and gives you the CSS class selector name.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Selected &#039;View Style Information&#039; from Firefox&#039;s Web Developer Toolbar which highlights the area under the cursor and gives you the CSS class selector name. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;(Of course view source also works, this is just faster.)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*For the menu that turned out to be &amp;#039;cc_playlist_owner&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*For the menu that turned out to be &amp;#039;cc_playlist_owner&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*I searched under &amp;#039;&amp;#039;&amp;#039;ccskins&amp;#039;&amp;#039;&amp;#039; for all occurances of that selector.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*I searched under &amp;#039;&amp;#039;&amp;#039;ccskins&amp;#039;&amp;#039;&amp;#039; for all occurances of that selector.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Fourstones</name></author>
	</entry>
	<entry>
		<id>https://wiki-dev.creativecommons.org/index.php?title=Cchost/developer/Reverse_Engineering&amp;diff=19943&amp;oldid=prev</id>
		<title>Fourstones: New page: ==A ccHost Quick Reverse Engineer== by Victor  When I sat down to write the auto &#039;feature this playlist&#039; feature I knew I wanted to add a me...</title>
		<link rel="alternate" type="text/html" href="https://wiki-dev.creativecommons.org/index.php?title=Cchost/developer/Reverse_Engineering&amp;diff=19943&amp;oldid=prev"/>
		<updated>2008-11-17T23:08:33Z</updated>

		<summary type="html">&lt;p&gt;New page: ==A ccHost Quick Reverse Engineer== by Victor  When I sat down to write the &lt;a href=&quot;/wiki/Cchost/developer/tutorial/Featured_Playlist&quot; title=&quot;Cchost/developer/tutorial/Featured Playlist&quot;&gt;auto &amp;#039;feature this playlist&amp;#039;&lt;/a&gt; feature I knew I wanted to add a me...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==A ccHost Quick Reverse Engineer==&lt;br /&gt;
by Victor&lt;br /&gt;
&lt;br /&gt;
When I sat down to write the [[Cchost/developer/tutorial/Featured_Playlist|auto &amp;#039;feature this playlist&amp;#039;]] feature I knew I wanted to add a menu item to the playlist&amp;#039;s command window but I totally forgot how that menu was generated. It took less than a minute to figure it out but I thought it might be useful since I know this kind of &amp;#039;view source/reverse engineer&amp;#039; is how most developers approach a codebase like ccHost.&lt;br /&gt;
&lt;br /&gt;
Firefox has a &amp;#039;Web Developer Toolbar&amp;#039; that I find invaluable. &lt;br /&gt;
&lt;br /&gt;
*I [http://ccmixter.org/playlist/browse/10 browsed to a playlist]. &lt;br /&gt;
*Selected &amp;#039;View Style Information&amp;#039; from Firefox&amp;#039;s Web Developer Toolbar which highlights the area under the cursor and gives you the CSS class selector name.&lt;br /&gt;
*For the menu that turned out to be &amp;#039;cc_playlist_owner&amp;#039;&lt;br /&gt;
*I searched under &amp;#039;&amp;#039;&amp;#039;ccskins&amp;#039;&amp;#039;&amp;#039; for all occurances of that selector.&lt;br /&gt;
*I found the template that built the menu at &amp;#039;&amp;#039;&amp;#039;ccskins/shared/playlist_2_head.tpl&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;&amp;lt;ul class=&amp;quot;cc_playlist_owner_menu &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
                      light_bg dark_border&amp;quot;&amp;gt;&lt;br /&gt;
    %loop(#R/menu,mi)%&lt;br /&gt;
        &amp;lt;nowiki&amp;gt;&amp;lt;li&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
        &amp;lt;a target=&amp;quot;_parent&amp;quot; href=&amp;quot;%(#mi/url)%&amp;quot; &lt;br /&gt;
               id=&amp;quot;%(#mi/id)%&amp;quot; &lt;br /&gt;
               class=&amp;quot;%(#mi/class)%&amp;quot;&amp;gt;&amp;lt;span&amp;gt;%text(#mi/text)%&amp;lt;/span&amp;gt;&lt;br /&gt;
              &amp;lt;/a&amp;gt;&lt;br /&gt;
        &amp;lt;/li&amp;gt;&lt;br /&gt;
    %end_loop%&lt;br /&gt;
    &amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*From the code in this template I could deduce the following:&lt;br /&gt;
**the menu was just being displayed here. The menu was being built somewhere else.&lt;br /&gt;
**the menu itself is embedded in the &amp;#039;R&amp;#039; record&lt;br /&gt;
**a few lines above is line &amp;#039;&amp;#039;&amp;#039;%map(#R,records/0)%&amp;#039;&amp;#039;&amp;#039; which means &amp;#039;R&amp;#039; is result of the query (&amp;#039;records&amp;#039; is the array of a query result in a template)&lt;br /&gt;
**every query must have a dataview somewhere, sure enough at the top of the template &lt;br /&gt;
 to display this playlist, &amp;#039;&amp;#039;&amp;#039;dataview = playlist_detail&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*I found &amp;#039;&amp;#039;&amp;#039;ccdataviews/playlist_detail.php&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
*Since the &amp;#039;menu&amp;#039; is a PHP array and not a normal SQL column, I deduced there must a dataview filter that is building the menu&lt;br /&gt;
*Filter events are returned in an array in a dataview and there was &amp;#039;&amp;#039;CC_EVENT_FILTER_CART_MENU&amp;#039;&amp;#039; (a playlist is actually a record in the &amp;#039;&amp;#039;cc_tbl_carts&amp;#039;&amp;#039; table)&lt;br /&gt;
*I searched &amp;#039;&amp;#039;&amp;#039;cchost_lib/*&amp;#039;&amp;#039;&amp;#039; for that event and found the declaration of a handler in &amp;#039;&amp;#039;&amp;#039;cchost_lib/ccextras/cc-playlist.php&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*That pointed to a method in &amp;#039;&amp;#039;&amp;#039;cchost_lib/ccextras/cc-playlist-browse.inc&amp;#039;&amp;#039;&amp;#039; called &amp;#039;&amp;#039;CCPlaylistBrowse::OnFilterCartMenu&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
At this point I knew what event I had to handle &amp;#039;&amp;#039;CC_EVENT_FILTER_CART_MENU&amp;#039;&amp;#039; and I had an example of what the system was doing with that event in &amp;#039;&amp;#039;CCPlaylistBrowse::OnFilterCartMenu&amp;#039;&amp;#039;.&lt;/div&gt;</summary>
		<author><name>Fourstones</name></author>
	</entry>
</feed>