<?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>Open Script Solution&#187; display</title>
	<atom:link href="http://www.openscriptsolution.com/tag/display/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.openscriptsolution.com</link>
	<description>... where solutions for script programming are found ...</description>
	<lastBuildDate>Tue, 31 Jan 2012 03:22:52 +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>How to Display The Wider Logo in WordPress Login Page using Wp Customized Login Plugin</title>
		<link>http://www.openscriptsolution.com/2010/01/09/how-to-display-the-wider-logo-in-wordpress-login-page-using-wp-customized-login-plugin/</link>
		<comments>http://www.openscriptsolution.com/2010/01/09/how-to-display-the-wider-logo-in-wordpress-login-page-using-wp-customized-login-plugin/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 05:10:24 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[adjust]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[full]]></category>
		<category><![CDATA[height]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[logo]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[width]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=1086</guid>
		<description><![CDATA[Today I customized the WordPress logo that appears in wp-admin page with my own logo on one of my websites. I have been using Wp Customized Login plugin for this purpose. After installing and activating the plugin, everything seemed okay, until I found something that annoying me. It was about my own logo did not [...]]]></description>
			<content:encoded><![CDATA[<p>Today I customized the WordPress logo that appears in wp-admin page with my own logo on one of my websites. I have been using <a href="http://wordpress.org/extend/plugins/wp-customized-login/" target="_blank">Wp Customized Login plugin</a> for this purpose. After installing and activating the plugin, everything seemed okay, until I found something that annoying me. It was about my own logo did not appear full properly. The image seemed need to be a little too left and stops a little before the right side, since my dimension logo size is 500 pixels (width) x 100 pixels (height). Meanwhile, the recommended logo width by WordPress is about 300 pixels. After reading from <a href="http://www.thinkinginwordpress.com/2008/12/customized-wordpress-login-page-plugin/comment-page-1/#comment-54">the related comments in author&#8217;s website</a>, then I found the solution how to overcome my problem based on the comment from the author of this plugin. <span id="more-1086"></span></p>
<p>Open your <strong>/wp-content/plugins/wp-customized-login/custom-login.css</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#login</span> h1 a<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">logo.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#login</span> h1 a<span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">transparent</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">logo.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #993333;">scroll</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">100px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* adjust it with your logo's height */</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">500px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* adjust it with your logo's width */</span>
  <span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">-80px</span><span style="color: #00AA00;">;</span>  <span style="color: #808080; font-style: italic;">/* adjust it in order to make your logo centered */</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>You can see the demo result of the modification above from this login page of the following webiste: <a href="http://www.visualbasicindonesia.com/wp-admin/" target="_blank">Visual Basic Indonesia</a>.<br />
Hopefully this is helpful for you.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2010%2F01%2F09%2Fhow-to-display-the-wider-logo-in-wordpress-login-page-using-wp-customized-login-plugin%2F&amp;title=How%20to%20Display%20The%20Wider%20Logo%20in%20WordPress%20Login%20Page%20using%20Wp%20Customized%20Login%20Plugin" id="wpa2a_2"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2010/01/09/how-to-display-the-wider-logo-in-wordpress-login-page-using-wp-customized-login-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Displaying Some Comma-Separated Sub-String Values from A Single String to The Checked CheckBoxes Control in PHP</title>
		<link>http://www.openscriptsolution.com/2009/12/11/displaying-some-comma-separated-sub-string-values-from-a-single-string-to-the-checked-checkboxes-control-in-php/</link>
		<comments>http://www.openscriptsolution.com/2009/12/11/displaying-some-comma-separated-sub-string-values-from-a-single-string-to-the-checked-checkboxes-control-in-php/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 16:40:26 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[checkboxes]]></category>
		<category><![CDATA[checked]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[get]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=1004</guid>
		<description><![CDATA[Yesterday I faced a situation while I was trying to get some sub-string values that derived from a single string that being saved in database, and displayed them to the checked CheckBoxes control in PHP. Let&#8217;s say I had 5 CheckBoxes control named Applications on my form, whereas the values stored in a single string [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I faced a situation while I was trying to get some sub-string values that derived from a single string that being saved in database, and displayed them to the checked <strong>CheckBoxes</strong> control in PHP. Let&#8217;s say I had 5 CheckBoxes control named <strong>Applications</strong> on my form, whereas the values stored in a single string from database, for instance, is: &#8220;Application 1, Application 3, Application 5&#8243;. Then I wanted that the first, the third, and the fifth CheckBoxes would be checked based on that string. So, finally, I wrote this following code to solve my problem. <span id="more-1004"></span></p>
<p>Here is the code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
    <span style="color: #666666; font-style: italic;">// assuming the value of $strApplications received from database</span>
    <span style="color: #000088;">$strApplications</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Application 1, Application 3, Application 5&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
    &lt;tr&gt;
      &lt;td&gt;Applications: &lt;/td&gt;
      &lt;td&gt;
        <span style="color: #000000; font-weight: bold;">&lt;?php</span>  
	  <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$j</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #000088;">$j</span><span style="color: #339933;">&lt;=</span><span style="color: #cc66cc;">5</span><span style="color: #339933;">;</span> <span style="color: #000088;">$j</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>	          
            <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;input type=&quot;checkbox&quot; name=&quot;applications[]&quot; value=&quot;Application '</span><span style="color: #339933;">.</span><span style="color: #000088;">$j</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; '</span><span style="color: #339933;">;</span>		
	    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$strApplications</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Application '</span><span style="color: #339933;">.</span><span style="color: #000088;">$j</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!==</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	      <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'checked'</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// which checkbox(es) should be checked</span>
	    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
	      <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// otherwise, leave it unchecked</span>
	    <span style="color: #009900;">&#125;</span>	
	    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&gt;Application '</span><span style="color: #339933;">.</span><span style="color: #000088;">$j</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;br /&gt;'</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>
          <span style="color: #000000; font-weight: bold;">?&gt;</span>      
      &lt;/td&gt;
    &lt;/tr&gt;</pre></div></div>

<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2009%2F12%2F11%2Fdisplaying-some-comma-separated-sub-string-values-from-a-single-string-to-the-checked-checkboxes-control-in-php%2F&amp;title=Displaying%20Some%20Comma-Separated%20Sub-String%20Values%20from%20A%20Single%20String%20to%20The%20Checked%20CheckBoxes%20Control%20in%20PHP" id="wpa2a_4"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2009/12/11/displaying-some-comma-separated-sub-string-values-from-a-single-string-to-the-checked-checkboxes-control-in-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Display Categories and Pages in Menu of iNove Theme in WordPress</title>
		<link>http://www.openscriptsolution.com/2009/11/02/how-to-display-categories-and-pages-in-menu-of-inove-theme-in-wordpress/</link>
		<comments>http://www.openscriptsolution.com/2009/11/02/how-to-display-categories-and-pages-in-menu-of-inove-theme-in-wordpress/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 14:58:37 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Categories]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[iNove]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[Pages]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[wp_list_categories]]></category>
		<category><![CDATA[wp_list_pages]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=759</guid>
		<description><![CDATA[If you use iNove theme on your WordPress website, then by default you only can display categories OR pages in the menu section. Sometimes, you want to display both of categories and pages in the menu section of your theme. If you want to display either categories and pages in the menu section of your [...]]]></description>
			<content:encoded><![CDATA[<p>If you use <strong>iNove</strong> theme on your WordPress website, then by default you only can display categories OR pages in the menu section. Sometimes, you want to display both of categories and pages in the menu section of your theme. If you want to display either categories and pages in the menu section of your iNove theme, then you may use this following modification code. <span id="more-759"></span></p>
<p>Open your <strong>\wp-content\themes\inove\templates\header.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>30
31
32
33
34
35
36
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">		<span style="color: #000000; font-weight: bold;">&lt;?php</span>
			<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'menu_type'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'categories'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				wp_list_categories<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'title_li=&amp;orderby=name&amp;show_count=0&amp;hierarchical=1&amp;depth=3&amp;hide_empty=0'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
				wp_list_pages<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'title_li=&amp;sort_column=menu_order'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>30
31
32
33
34
35
36
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">		<span style="color: #000000; font-weight: bold;">&lt;?php</span>
			<span style="color: #666666; font-style: italic;">// if($options['menu_type'] == 'categories') {</span>
				wp_list_categories<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'title_li=&amp;orderby=name&amp;show_count=0&amp;hierarchical=1&amp;depth=3&amp;hide_empty=0'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #666666; font-style: italic;">// } else {</span>
				wp_list_pages<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'title_li=&amp;sort_column=menu_order'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #666666; font-style: italic;">// }</span>
		<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Now you should see the categories and also the pages show up in the menu section of your iNove themes.</p>
<p>Please note that by using this modification, then the <strong>menu type</strong> option that you specified will be ignored from your iNove options in admin panel of your WordPress.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2009%2F11%2F02%2Fhow-to-display-categories-and-pages-in-menu-of-inove-theme-in-wordpress%2F&amp;title=How%20to%20Display%20Categories%20and%20Pages%20in%20Menu%20of%20iNove%20Theme%20in%20WordPress" id="wpa2a_6"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2009/11/02/how-to-display-categories-and-pages-in-menu-of-inove-theme-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Show Ticket Only for Current User&#8217;s Department in osTicket v1.6 RC5</title>
		<link>http://www.openscriptsolution.com/2009/10/27/show-ticket-only-for-current-users-department-in-osticket-v1-6-rc5/</link>
		<comments>http://www.openscriptsolution.com/2009/10/27/show-ticket-only-for-current-users-department-in-osticket-v1-6-rc5/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 02:21:43 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[osTicket]]></category>
		<category><![CDATA[department]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[show]]></category>
		<category><![CDATA[staff]]></category>
		<category><![CDATA[ticket]]></category>
		<category><![CDATA[user]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=712</guid>
		<description><![CDATA[Have you ever wanted to display the tickets only for current staff user&#8217;s department in osTicket? As we know, the current condition in osTicket until version 1.6 RC5 is when a user display the ticket list from staff panel, then he/she can still see all the tickets that belong to another department. By using this [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever wanted to display the tickets only for current staff user&#8217;s department in osTicket? As we know, the current condition in osTicket until version 1.6 RC5 is when a user display the ticket list from staff panel, then he/she can still see all the tickets that belong to another department. By using this modification, now staff limited can only to see the tickets relevant to their department, either from the ticket list and the viewticket page. Well, here is the solution for you. <span id="more-712"></span></p>
<ol>
<li>
Open your <strong>\include\staff\tickets.inc.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>83
84
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #666666; font-style: italic;">//limited depts....user can access tickets assigned to them regardless of the dept.</span>
    <span style="color: #000088;">$qwhere</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">' WHERE (ticket.dept_id IN ('</span><span style="color: #339933;">.</span><span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">','</span><span style="color: #339933;">,</span><span style="color: #000088;">$depts</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">') OR ticket.staff_id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$thisuser</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">')'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>83
84
85
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #666666; font-style: italic;">//limited depts....user can access tickets assigned to them regardless of the dept.</span>
    <span style="color: #666666; font-style: italic;">//$qwhere =' WHERE (ticket.dept_id IN ('.implode(',',$depts).') OR ticket.staff_id='.$thisuser-&gt;getId().')';</span>
    <span style="color: #000088;">$qwhere</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">' WHERE (ticket.dept_id = '</span><span style="color: #339933;">.</span><span style="color: #000088;">$thisuser</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getDeptId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' OR ticket.staff_id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$thisuser</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">')'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

</li>
<li>
Open your <strong>\scp\tickets.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>24
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$ticket</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//clean start.</span></pre></td></tr></table></div>

<p>after that line, please insert this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>25
26
27
28
29
30
31
32
33
34
35
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #339933;">=</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span>?<span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ticket_id'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">is_numeric</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$qselect</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'SELECT ticketID, dept_id, staff_id FROM '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span> 
             <span style="color: #0000ff;">' WHERE ticket_id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$id</span><span style="color: #339933;">.</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$rselect</span> <span style="color: #339933;">=</span> db_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$qselect</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>db_num_rows<span style="color: #009900;">&#40;</span><span style="color: #000088;">$rselect</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ticketID</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dept_id</span><span style="color: #339933;">,</span><span style="color: #000088;">$staff_id</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> db_fetch_row<span style="color: #009900;">&#40;</span><span style="color: #000088;">$rselect</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dept_id</span><span style="color: #339933;">!=</span><span style="color: #000088;">$thisuser</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getDeptId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$staff_id</span><span style="color: #339933;">!=</span><span style="color: #000088;">$thisuser</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
      <span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'err'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'The ticket # '</span><span style="color: #339933;">.</span><span style="color: #000088;">$ticketID</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' belongs to another department!'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Find again this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>407
408
409
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$thisuser</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isAdmin</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$sql</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">' WHERE ticket.dept_id IN('</span><span style="color: #339933;">.</span><span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">','</span><span style="color: #339933;">,</span><span style="color: #000088;">$thisuser</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getDepts</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">') OR ticket.staff_id='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$thisuser</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>407
408
409
410
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$thisuser</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isAdmin</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">//$sql.=' WHERE ticket.dept_id IN('.implode(',',$thisuser-&gt;getDepts()).') OR ticket.staff_id='.db_input($thisuser-&gt;getId());</span>
    <span style="color: #000088;">$sql</span> <span style="color: #339933;">.=</span><span style="color: #0000ff;">' WHERE (ticket.dept_id = '</span><span style="color: #339933;">.</span><span style="color: #000088;">$thisuser</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getDeptId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' OR ticket.staff_id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$thisuser</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">')'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

</li>
</ol>
<p>That&#8217;s all. Enjoy the result! <img src='http://www.openscriptsolution.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2009%2F10%2F27%2Fshow-ticket-only-for-current-users-department-in-osticket-v1-6-rc5%2F&amp;title=Show%20Ticket%20Only%20for%20Current%20User%26%238217%3Bs%20Department%20in%20osTicket%20v1.6%20RC5" id="wpa2a_8"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2009/10/27/show-ticket-only-for-current-users-department-in-osticket-v1-6-rc5/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>View Image Attachment in osTicket v1.6 RC5</title>
		<link>http://www.openscriptsolution.com/2009/10/26/view-image-attachment-in-osticket-v1-6-rc5/</link>
		<comments>http://www.openscriptsolution.com/2009/10/26/view-image-attachment-in-osticket-v1-6-rc5/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 03:27:58 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[osTicket]]></category>
		<category><![CDATA[attachment]]></category>
		<category><![CDATA[directory]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[jpg]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=702</guid>
		<description><![CDATA[I was interested with one of the topic in osTicket Discussion Forum about how to display the image attachment which its extention such as: jpg, gif, png, and bmp directly on the browser, then I made another modification which will automatically detect the URL and the directory name where the attachments file located. This code [...]]]></description>
			<content:encoded><![CDATA[<p>I was interested with one of the topic in osTicket Discussion Forum about <a href="http://www.osticket.com/forums/showthread.php?t=1034">how to display the image attachment</a> which its extention such as: jpg, gif, png, and bmp directly on the browser, then I made another modification which will automatically detect the URL and the directory name where the attachments file located. This code will work, with assuming: the sub directory for your attachment files located one level under the main directory of your osTicket. For example: your osTicket installed in &#8220;support&#8221; directory, whereas the attachment file located one level under the &#8220;support&#8221; directory, with named: &#8220;attachment&#8221;. This modification will also automatically resize the image width if it is greater than the maximum of osTicket width area on viewticket page. We assume that the maximum ticket width is 820 pixels (based on its css file). <span id="more-702"></span></p>
<p>Open your <strong>\include\class.ticket.php</strong> file, and find the <strong>getAttachmentStr</strong> function, then replace all code of its function become like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #666666; font-style: italic;">// Modified by Masino Sinaga, last updated: November 5, 2009</span>
    <span style="color: #666666; font-style: italic;">// in order to display image properly inside the ticket area</span>
    <span style="color: #666666; font-style: italic;">// especially if the image's width greater than 820 px, then</span>
    <span style="color: #666666; font-style: italic;">// resize the image's width maximum to 820 px. </span>
    <span style="color: #000000; font-weight: bold;">function</span> getAttachmentStr<span style="color: #009900;">&#40;</span><span style="color: #000088;">$refid</span><span style="color: #339933;">,</span><span style="color: #000088;">$type</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$cfg</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$helpdesk_url</span><span style="color: #339933;">=</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getUrl</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>       
        <span style="color: #000088;">$dir</span><span style="color: #339933;">=</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getUploadDir</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>        
        <span style="color: #000088;">$dir</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/<span style="color: #000099; font-weight: bold;">\\</span><span style="color: #000099; font-weight: bold;">\\</span>/&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$dir</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$arrDir</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_reverse</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$dir</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$arrDir</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>        
        <span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT attach_id,file_size,file_name,file_key FROM '</span><span style="color: #339933;">.</span>TICKET_ATTACHMENT_TABLE<span style="color: #339933;">.</span>
             <span style="color: #0000ff;">' WHERE deleted=0 AND ticket_id='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' AND ref_id='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$refid</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' AND ref_type='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$type</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$res</span><span style="color: #339933;">=</span>db_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$res</span> <span style="color: #339933;">&amp;&amp;</span> db_num_rows<span style="color: #009900;">&#40;</span><span style="color: #000088;">$res</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #339933;">,</span><span style="color: #000088;">$size</span><span style="color: #339933;">,</span><span style="color: #000088;">$name</span><span style="color: #339933;">,</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">=</span>db_fetch_row<span style="color: #009900;">&#40;</span><span style="color: #000088;">$res</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$hash</span><span style="color: #339933;">=</span><span style="color: #990000;">MD5</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #000088;">$refid</span><span style="color: #339933;">.</span><span style="color: #990000;">session_id</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$size</span><span style="color: #339933;">=</span>Format<span style="color: #339933;">::</span><span style="color: #004000;">file_size</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$size</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$ext</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">strrchr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$name</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'.'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$fullfilename</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$helpdesk_url</span><span style="color: #339933;">.</span><span style="color: #000088;">$dir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">.</span><span style="color: #000088;">$key</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'_'</span><span style="color: #339933;">.</span><span style="color: #000088;">$name</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">in_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ext</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'jpg'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'png'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'gif'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'bmp'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                  <span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$width</span><span style="color: #339933;">,</span> <span style="color: #000088;">$height</span><span style="color: #339933;">,</span> <span style="color: #000088;">$type</span><span style="color: #339933;">,</span> <span style="color: #000088;">$attr</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">getimagesize</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fullfilename</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$width</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">820</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		      <span style="color: #000088;">$attachstr</span><span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;p align=&quot;center&quot;&gt;&lt;a href=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$fullfilename</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$fullfilename</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; width=&quot;820&quot;/&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;'</span><span style="color: #339933;">;</span>
		    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		      <span style="color: #000088;">$attachstr</span><span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;p align=&quot;center&quot;&gt;&lt;a href=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$fullfilename</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$fullfilename</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;'</span><span style="color: #339933;">;</span>
		    <span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
                <span style="color: #000088;">$attachstr</span><span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;a class='Icon file' href='attachment.php?id=<span style="color: #006699; font-weight: bold;">$id</span>&amp;ref=<span style="color: #006699; font-weight: bold;">$hash</span>' target='_blank'&gt;&lt;b&gt;<span style="color: #006699; font-weight: bold;">$name</span>&lt;/b&gt;&lt;/a&gt;&amp;nbsp;(&lt;i&gt;<span style="color: #006699; font-weight: bold;">$size</span>&lt;/i&gt;)&amp;nbsp;&amp;nbsp;&quot;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$attachstr</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span></pre></div></div>

<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2009%2F10%2F26%2Fview-image-attachment-in-osticket-v1-6-rc5%2F&amp;title=View%20Image%20Attachment%20in%20osTicket%20v1.6%20RC5" id="wpa2a_10"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2009/10/26/view-image-attachment-in-osticket-v1-6-rc5/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Display The Forgot Ticket Number List Including The Closed Status in osTicket v1.6 RC5</title>
		<link>http://www.openscriptsolution.com/2009/10/06/display-the-forgot-ticket-number-list-including-the-closed-status-in-osticket-v1-6-rc5/</link>
		<comments>http://www.openscriptsolution.com/2009/10/06/display-the-forgot-ticket-number-list-including-the-closed-status-in-osticket-v1-6-rc5/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 12:25:25 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[osTicket]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[closed]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[open]]></category>
		<category><![CDATA[panel]]></category>
		<category><![CDATA[status]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[ticket]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=504</guid>
		<description><![CDATA[For those of you who have implemented the modification I made for osTicket through this article: Add Forgot Ticket Number Feature into osTicket System v1.6 RC5 and need to display the forgot ticket number list including the ticket which have closed status, I made a modification regarding this. Please make sure that you have implemented [...]]]></description>
			<content:encoded><![CDATA[<p>For those of you who have implemented the modification I made for osTicket through this article: <a href="http://www.openscriptsolution.com/2009/09/12/add-forgot-ticket-number-feature-into-osticket-system-v1-6-rc5/" target="_blank">Add Forgot Ticket Number Feature into osTicket System v1.6 RC5</a> and need to display the forgot ticket number list including the ticket which have closed status, I made a modification regarding this. Please make sure that you have implemented that modification on that link above before doing this modification. <span id="more-504"></span></p>
<ol>
<li>
Open <strong>forgotticket.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">  <span style="color: #000088;">$sqle</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT email, ticketID, name FROM '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span>
      <span style="color: #0000ff;">' WHERE email='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$femail</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' AND status = &quot;open&quot;'</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$respe</span><span style="color: #339933;">=</span>db_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sqle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$ticketNumber</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$countRec</span> <span style="color: #339933;">=</span> db_num_rows<span style="color: #009900;">&#40;</span><span style="color: #000088;">$respe</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$countRec</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$nameForgot</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$email</span><span style="color: #339933;">,</span><span style="color: #000088;">$ticketID</span><span style="color: #339933;">,</span><span style="color: #000088;">$name</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> db_fetch_row<span style="color: #009900;">&#40;</span><span style="color: #000088;">$respe</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	  <span style="color: #000088;">$ticketNumber</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$ticketID</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #000088;">$ticketNumber</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;, &quot;</span><span style="color: #339933;">.</span> <span style="color: #000088;">$ticketID</span><span style="color: #339933;">;</span>	
      <span style="color: #009900;">&#125;</span>
      <span style="color: #000088;">$nameForgot</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$name</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$i</span><span style="color: #339933;">++;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000088;">$tplId</span><span style="color: #339933;">=</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getDefaultTemplateId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$sql</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT forgot_ticket_subj,forgot_ticket_body FROM '</span><span style="color: #339933;">.</span>EMAIL_TEMPLATE_TABLE<span style="color: #339933;">.</span>
          <span style="color: #0000ff;">' WHERE cfg_id='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' AND tpl_id='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$tplId</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$resp</span><span style="color: #339933;">=</span>db_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>db_num_rows<span style="color: #009900;">&#40;</span><span style="color: #000088;">$resp</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$subj</span><span style="color: #339933;">,</span><span style="color: #000088;">$body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">=</span>db_fetch_row<span style="color: #009900;">&#40;</span><span style="color: #000088;">$resp</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$body</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;%name&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$nameForgot</span><span style="color: #339933;">,</span> <span style="color: #000088;">$body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$body</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #009933; font-weight: bold;">%e</span>mail&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$email</span><span style="color: #339933;">,</span> <span style="color: #000088;">$body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$body</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;%ticketlist&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$ticketNumber</span><span style="color: #339933;">,</span> <span style="color: #000088;">$body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">  <span style="color: #000088;">$sqle</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT email, ticketID, name, status FROM '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span>
      <span style="color: #0000ff;">' WHERE email='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$femail</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$respe</span><span style="color: #339933;">=</span>db_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sqle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$ticketNumber</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$countRec</span> <span style="color: #339933;">=</span> db_num_rows<span style="color: #009900;">&#40;</span><span style="color: #000088;">$respe</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$countRec</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$j</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$nameForgot</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$email</span><span style="color: #339933;">,</span><span style="color: #000088;">$ticketID</span><span style="color: #339933;">,</span><span style="color: #000088;">$name</span><span style="color: #339933;">,</span><span style="color: #000088;">$status</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> db_fetch_row<span style="color: #009900;">&#40;</span><span style="color: #000088;">$respe</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$status</span><span style="color: #339933;">==</span><span style="color: #0000ff;">'open'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #000088;">$ticketNumber</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$ticketID</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #000088;">$ticketNumber</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;, &quot;</span><span style="color: #339933;">.</span> <span style="color: #000088;">$ticketID</span><span style="color: #339933;">;</span>	
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000088;">$i</span><span style="color: #339933;">++;</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// closed status</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$j</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #000088;">$ticketClosed</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$ticketID</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #000088;">$ticketClosed</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;, &quot;</span><span style="color: #339933;">.</span> <span style="color: #000088;">$ticketID</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000088;">$j</span><span style="color: #339933;">++;</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #000088;">$nameForgot</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$name</span><span style="color: #339933;">;</span>  	  
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000088;">$tplId</span><span style="color: #339933;">=</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getDefaultTemplateId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$sql</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT forgot_ticket_subj,forgot_ticket_body FROM '</span><span style="color: #339933;">.</span>EMAIL_TEMPLATE_TABLE<span style="color: #339933;">.</span>
         <span style="color: #0000ff;">' WHERE cfg_id='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' AND tpl_id='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$tplId</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$resp</span><span style="color: #339933;">=</span>db_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>db_num_rows<span style="color: #009900;">&#40;</span><span style="color: #000088;">$resp</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$subj</span><span style="color: #339933;">,</span><span style="color: #000088;">$body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">=</span>db_fetch_row<span style="color: #009900;">&#40;</span><span style="color: #000088;">$resp</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
      <span style="color: #000088;">$body</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;%name&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$nameForgot</span><span style="color: #339933;">,</span> <span style="color: #000088;">$body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$body</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #009933; font-weight: bold;">%e</span>mail&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$email</span><span style="color: #339933;">,</span> <span style="color: #000088;">$body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$body</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;%ticketlist&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$ticketNumber</span><span style="color: #339933;">,</span> <span style="color: #000088;">$body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$body</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;%ticketclosed&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$ticketClosed</span><span style="color: #339933;">,</span> <span style="color: #000088;">$body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

</li>
<li>
Adjust the email template from your admin panel menu: <strong>Emails -> Templates</strong>:</p>
<p>from:</p>
<blockquote><p>Subject = Forgot Ticket Number<br />
Message Body = %name,</p>
<p>This is the list of your tickets:<br />
%ticketlist</p>
<p>Admin</p></blockquote>
<p>become:</p>
<blockquote><p>Subject = Forgot Ticket Number<br />
Message Body = %name,</p>
<p>This is the list of your opened tickets:<br />
%ticketlist</p>
<p>This is the list of your closed tickets:<br />
%ticketclosed</p>
<p>Admin</p></blockquote>
</li>
</ol>
<p>Hopefully this is helpful.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2009%2F10%2F06%2Fdisplay-the-forgot-ticket-number-list-including-the-closed-status-in-osticket-v1-6-rc5%2F&amp;title=Display%20The%20Forgot%20Ticket%20Number%20List%20Including%20The%20Closed%20Status%20in%20osTicket%20v1.6%20RC5" id="wpa2a_12"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2009/10/06/display-the-forgot-ticket-number-list-including-the-closed-status-in-osticket-v1-6-rc5/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>How to Make Searching and Displaying Knowledge Base Working in osTicket System</title>
		<link>http://www.openscriptsolution.com/2009/09/13/how-to-make-searching-and-displaying-knowledge-base-working-in-osticket-system/</link>
		<comments>http://www.openscriptsolution.com/2009/09/13/how-to-make-searching-and-displaying-knowledge-base-working-in-osticket-system/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 10:22:27 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[osTicket]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[knowledge base]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=304</guid>
		<description><![CDATA[Both osTicket System version 1.6 RC4 and 1.6 RC5 have not implemented displaying and searching Knowledge Base properly. Every time I try to search the certain keyword that already exists in database, this system always gives me an output: Query returned 0 results. This is really really weird, I think. So I made a modification [...]]]></description>
			<content:encoded><![CDATA[<p>Both osTicket System version 1.6 RC4 and 1.6 RC5 have not implemented displaying and searching Knowledge Base properly. Every time I try to search the certain keyword that already exists in database, this system always gives me an output: <strong>Query returned 0 results</strong>. This is really really weird, I think. So I made a modification in order staffs are able to search and displaying the result based on the keyword they entered. <span id="more-304"></span></p>
<p>Open <strong>\include\staff\premade.inc.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//List premade answers.</span>
<span style="color: #000088;">$select</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT premade.*,dept_name '</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$from</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'FROM '</span><span style="color: #339933;">.</span>KB_PREMADE_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' premade LEFT JOIN '</span><span style="color: #339933;">.</span>DEPT_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' USING(dept_id) '</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//make sure the search query is 3 chars min...defaults to no query with warning message</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'a'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">==</span><span style="color: #0000ff;">'search'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'query'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">||</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'query'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'err'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'Search term must be more than 3 chars'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">//fulltext search.</span>
        <span style="color: #000088;">$search</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$qstr</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">'&amp;a='</span><span style="color: #339933;">.</span><span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'a'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$qstr</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">'&amp;query='</span><span style="color: #339933;">.</span><span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'query'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$where</span><span style="color: #339933;">=</span><span style="color: #0000ff;">' WHERE MATCH(title,answer) AGAINST ('</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'query'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">')'</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dept'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
            <span style="color: #000088;">$where</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">' AND dept_id='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dept'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//I admit this crap sucks...but who cares??</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//List premade answers.</span>
<span style="color: #000088;">$select</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT DISTINCT(d.dept_name), premade.* '</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$from</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'FROM '</span><span style="color: #339933;">.</span>KB_PREMADE_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' premade, '</span><span style="color: #339933;">.</span>DEPT_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' d '</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//make sure the search query is 3 chars min...defaults to no query with warning message</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'a'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">==</span><span style="color: #0000ff;">'search'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'query'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">||</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'query'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'err'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span>I_S_PREM_SEARCH_TERM<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">//fulltext search.</span>
        <span style="color: #000088;">$search</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$qstr</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">'&amp;a='</span><span style="color: #339933;">.</span><span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'a'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$qstr</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">'&amp;query='</span><span style="color: #339933;">.</span><span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'query'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$searchfor</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'query'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$where</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot; WHERE (premade.title LIKE '%<span style="color: #006699; font-weight: bold;">$searchfor</span>%' 
                 OR premade.answer LIKE '%<span style="color: #006699; font-weight: bold;">$searchfor</span>%') 
                 AND (d.dept_id = premade.dept_id OR premade.dept_id = 0) &quot;</span><span style="color: #339933;">;</span> 
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dept'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
            <span style="color: #000088;">$where</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">' AND d.dept_id='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dept'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$where</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$where</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'WHERE d.dept_id = premade.dept_id 
                              OR premade.dept_id = 0'</span><span style="color: #339933;">;</span> 
<span style="color: #666666; font-style: italic;">//I admit this crap sucks...but who cares??</span></pre></td></tr></table></div>

<p>Now staffs are able to search and displaying the result properly. Besides that, if a <strong>Premade Reply</strong> belongs to <strong>All Departments</strong> (for example, currently you already have 3 departments), then you will see now in the table list of <strong>Premade Replies</strong>, there are 3 records of Premade Reply for that 3 departments. With this way, when staff search for Premade Reply that belongs to certain department, then system will display the record belongs to such department only.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2009%2F09%2F13%2Fhow-to-make-searching-and-displaying-knowledge-base-working-in-osticket-system%2F&amp;title=How%20to%20Make%20Searching%20and%20Displaying%20Knowledge%20Base%20Working%20in%20osTicket%20System" id="wpa2a_14"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2009/09/13/how-to-make-searching-and-displaying-knowledge-base-working-in-osticket-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Never Display The Ticket Number After Client Submit A New Ticket!</title>
		<link>http://www.openscriptsolution.com/2009/08/27/never-display-the-ticket-number-after-client-submit-a-new-ticket/</link>
		<comments>http://www.openscriptsolution.com/2009/08/27/never-display-the-ticket-number-after-client-submit-a-new-ticket/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 11:28:14 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[osTicket]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[never]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[system]]></category>
		<category><![CDATA[ticket]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=105</guid>
		<description><![CDATA[osTicket System is one of the best open-source ticket system until now. I have been testing and using it since version 1.6 RC4. The last version when I created this article is 1.6 RC5. For those both version, it is still using the email address and the ticket number to log in to the system, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.osticket.com" target="_blank">osTicket System</a> is one of the best open-source ticket system until now. I have been testing and using it since version 1.6 RC4. The last version when I created this article is 1.6 RC5. For those both version, it is still using the <strong>email address</strong> and the <strong>ticket number</strong> to log in to the system, in order to check the ticket status. If client open or submit a new ticket, then the ticket number will be sent to the client&#8217;s email address. Thus, client have to check their email address first, in order to get this ticket number to monitor the ticket status afterwards. Client have to enter the email address, and of course, the ticket number that sent through that email. <span id="more-105"></span></p>
<p>I watched for some topic discussion through <a href="http://www.osticket.com/forums/" target="_blank">osTicket Official Forum</a>, and I found there that one of the most important issues in osTicket System is about displaying the ticket number to the client after they submit a new ticket. At least, more than one topic asking and or request the feature about this issue. They need this feature to be implemented in osTicket System.</p>
<p>As a matter of fact, this ticket number is similar with password. Thus, it has to be sent via client&#8217;s email right after client submit a new ticket. Unfortunately, many ticket system administrator and or developer do not know this reason why &#8220;displaying ticket number after client submit new ticket&#8221; was strongly forbidden. There are some developers do not agree with this rule. They want to modify the osTicket script in order to display the ticket number on &#8220;thank you&#8221; page after client submit a new ticket. Many reason why they asked this feature. One of the their reasons I ever read is: &#8220;<em>&#8230; since my client never received the email that contains of the ticket number, I need this ticket number to be displayed right after my client submit a new ticket. I don&#8217;t need send the ticket number sent through the email address&#8217; client!</em>&#8220;.</p>
<p>Okay. Let&#8217;s discuss more detail about this. It is, indeed, strongly recommended that the ticket number should not being displayed after your client submit a new ticket. Aah, there must be, at least, one reason for this! The main reason for this is concerning the security vulnerability. Another reason that related with that reason above is: for some ticket systems, they allow their client to reply to the ticket by using email. Thus, this client&#8217; email is obviously needed in this case.</p>
<p>Now, let&#8217;s take a look an example here. If you display this ticket number to your client, imagine when somebody else (Mr. X) who knows your client&#8217;s email address. Then he acts or pretends to be one of your real client who has that email address, by opening a new ticket. Afterwards, this Mr. X will be able to login by using the email address and that ticket number (the ticket number that has just been displayed a few seconds after he submits that ticket). He will be able to see all of the tickets belongs to your client. Imagine again, how if one of those tickets number contain of such an important or secret information? Do you think this is a good condition in your osTicket System?</p>
<p>If the problem is about your client never receive any email that contains the ticket number, you have to ensure that your email system works correctly. For example, if you use your SMTP, please check your SMTP setting, in case there is a wrong setting there. Also, you have to give such explanation to your client to enter their valid email address in order the ticket number could be sent to their mail inbox properly. It means that email address is a mandatory thing if you want to implement a support system by using this osTicket System. So, there is no reason anymore to avoid to use your client&#8217;s email address.</p>
<p>The conclusion: For those of you who want to implement this osTicket System for your online support, please pay attention more seriously, especially when you want to implement it on your website. Always try to remember this: <strong>Do not ever display the ticket number after submit a new ticket!</strong> Another alternative solution that you can choose is by using username and password to log in to the system by your client. And, please remember again, it also needs your client&#8217;s valid email address, as the mandatory thing for your osTicket System.</p>
<p>Please consider again all the explanation above, if you do not want to disappointed your client, since there are so many bad guy out there who will try to pretend as your client, in order to display and know about your client&#8217;s matter or their important information. So, be a wise people when you want to modify this osTicket System script.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2009%2F08%2F27%2Fnever-display-the-ticket-number-after-client-submit-a-new-ticket%2F&amp;title=Never%20Display%20The%20Ticket%20Number%20After%20Client%20Submit%20A%20New%20Ticket%21" id="wpa2a_16"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2009/08/27/never-display-the-ticket-number-after-client-submit-a-new-ticket/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
