<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "How to: Add an extra field for the advanced guestbook"]]></title>
		<link>https://proxy2.de/forum/posts/list/3.php</link>
		<description><![CDATA[Latest messages posted in the topic "How to: Add an extra field for the advanced guestbook"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>How to: Add an extra field for the advanced guestbook</title>
				<description><![CDATA[ One of the things people are looking for is to add an extra field to the guestbook.<br /> So I tried this experiment.<br /> <br /> This version is for the plain version of the advanced guestbook.<br /> <br /> Until now is works, the only problem at the moment is that when you preview the entry the extra field isn’t written away.<br /> I don’t have any time at the moment to find out what the problem is and to support it.<br /> But maybe somebody else knows what is wrong and shares the solution with us.<br /> <br /> To use it:<br /> <br /> 1.   Import the table.<br /> 2.   Change “extra1” and “extra field:” with the name you want, “extra1 is the database name and “extra field:” is what the guestbook shows the guests.<br /> 3.   Replace “Your_picture.gif"” with the image you want to see.<br /> 4.   Just follow the instructions.<br /> <br /> <br /> <br /> Import this table into your database:<br /> <br /> [code]# MySQL dump 8.16<br /> #<br /> # Host&#58; localhost    Database&#58; gb23<br /> #--------------------------------------------------------<br /> # Server version   3.23.42<br /> <br /> #<br /> # alter Table structure for table 'Extra Field'<br /> #<br /> <br /> ALTER TABLE `book_data` ADD `extra1` varchar&#40;70&#41; NOT NULL default '';  <br /> ALTER TABLE `book_private` ADD `extra1` varchar&#40;70&#41; NOT NULL default '';  [/code] <br /> <br /> <br /> Open index.php<br /> <br /> Find:<br /> [code]$gb_post-&gt;location = &#40;isset&#40;$HTTP_POST_VARS&#91;&quot;gb_location&quot;&#93;&#41;&#41; ? $HTTP_POST_VARS&#91;&quot;gb_location&quot;&#93; &#58; '';[/code]<br /> <br /> Add  after:<br /> [code]$gb_post-&gt;extra1 = &#40;isset&#40;$HTTP_POST_VARS&#91;&quot;gb_ extra1&quot;&#93;&#41;&#41; ? $HTTP_POST_VARS&#91;&quot;gb_ extra1&quot;&#93; &#58; '';[/code]<br /> <br /> <br /> <br /> Open addentry.php<br /> <br /> Find:<br /> [code]$gb_post-&gt;location = &#40;isset&#40;$HTTP_POST_VARS&#91;&quot;gb_location&quot;&#93;&#41;&#41; ? $HTTP_POST_VARS&#91;&quot;gb_location&quot;&#93; &#58; '';[/code]<br /> <br /> Add  after:<br /> [code]$gb_post-&gt;extra1 = &#40;isset&#40;$HTTP_POST_VARS&#91;&quot;gb_extra1&quot;&#93;&#41;&#41; ? $HTTP_POST_VARS&#91;&quot;gb_extra1&quot;&#93; &#58; '';[/code]<br /> <br /> <br /> <br /> Open templates/entry.php<br /> <br /> Find:<br /> [code]     &lt;tr&gt;<br />        &lt;td colspan=&quot;2&quot; class=&quot;font1&quot;&gt;$LANG&#91;FormLoc&#93;&#58;&lt;br&gt;$row&#91;location&#93;&lt;/td&gt;<br />      &lt;/tr&gt;[/code]<br /> <br /> Add after:<br /> [code]     &lt;tr&gt;<br />        &lt;td colspan=&quot;2&quot; class=&quot;font2&quot;&gt;Extra Field 1&#58;&lt;br&gt;$row&#91;extra1&#93;&lt;/td&gt;<br />      &lt;/tr&gt;[/code]<br /> <br /> <br /> Open templates/form.php<br /> <br /> Find:<br /> [code]  &lt;tr bgcolor=&quot;$VARS&#91;tb_color_1&#93;&quot;&gt;<br />     &lt;td width=&quot;25%&quot; class=&quot;font1&quot;&gt;&lt;img src=&quot;$GB_PG&#91;base_url&#93;/img/location.gif&quot; width=&quot;16&quot; height=&quot;16&quot;&gt; $LANG&#91;FormLoc&#93;&#58;&lt;/td&gt;<br />     &lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;gb_location&quot; size=&quot;42&quot; maxlength=&quot;30&quot;&gt;&lt;/td&gt;<br />    &lt;/tr&gt;[/code]<br /> <br /> Add after:<br /> [code]  &lt;tr bgcolor=&quot;$VARS&#91;tb_color_1&#93;&quot;&gt;<br />     &lt;td width=&quot;25%&quot; class=&quot;font1&quot;&gt;&lt;img src=&quot;$GB_PG&#91;base_url&#93;/img/Your_picture.gif&quot; width=&quot;24&quot; height=&quot;14&quot;&gt; Extra Field 1&#58;&lt;/td&gt;<br />     &lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;gb_extra1&quot; size=&quot;42&quot; maxlength=&quot;50&quot;&gt;&lt;/td&gt;<br /> &lt;/tr&gt;[/code]<br /> <br /> <br /> Open templates/previewentry.php<br /> <br /> Find:<br /> [code]&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;font2&quot;&gt;$LANG&#91;FormLoc&#93;&#58;&lt;br&gt;$row&#91;location&#93;&lt;/td&gt;<br /> &lt;/tr&gt;[/code]<br /> <br /> Add after:<br /> [code]&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;font2&quot;&gt;Extra Field 1&#58;&lt;br&gt;$row&#91;extra1&#93;&lt;/td&gt;<br /> &lt;/tr&gt;[/code]<br /> <br /> <br /> <br /> Open admin/panel_edit.php<br /> <br /> Find:<br /> [code]    &lt;tr bgcolor=&quot;#EFEFEF&quot;&gt;<br />       &lt;td width=&quot;25%&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;Location&#58;&lt;/font&gt;&lt;/td&gt;<br />       &lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;location&quot; size=&quot;44&quot; maxlength=&quot;60&quot; value=&quot;&lt;?php echo $row&#91;'location'&#93;; ?&gt;&quot;&gt;&lt;/td&gt;<br />     &lt;/tr&gt;[/code]<br /> Add after:<br /> [code]    &lt;tr bgcolor=&quot;#EFEFEF&quot;&gt;<br />       &lt;td width=&quot;25%&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;Extra Field 1&#58;&lt;/font&gt;&lt;/td&gt;<br />       &lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;extra1&quot; size=&quot;44&quot; maxlength=&quot;60&quot; value=&quot;&lt;?php echo $row&#91;'extra1'&#93;; ?&gt;&quot;&gt;&lt;/td&gt;<br />     &lt;/tr&gt;[/code]<br /> <br /> <br /> Open admin/panel_easy.php<br /> <br /> Find:<br /> [code]if &#40;$row&#91;'location'&#93;&#41; &#123;<br />   echo &quot;    &lt;tr&gt;\n     &lt;td&gt;&lt;b&gt;&lt;font size=1&gt;Location&#58;&lt;/font&gt;&lt;/b&gt;&lt;/td&gt;<br />      &lt;td&gt;&lt;font size=1&gt;$row&#91;location&#93;&lt;/font&gt;&lt;/td&gt;\n    &lt;/tr&gt;\n&quot;;<br /> &#125;     [/code] <br /> Add after:<br /> [code]if &#40;$row&#91;'extra1'&#93;&#41; &#123;<br />   echo &quot;    &lt;tr&gt;\n     &lt;td&gt;&lt;b&gt;&lt;font size=1&gt;Extra Field 1&#58;&lt;/font&gt;&lt;/b&gt;&lt;/td&gt;<br />      &lt;td&gt;&lt;font size=1&gt;$row&#91;extra1&#93;&lt;/font&gt;&lt;/td&gt;\n    &lt;/tr&gt;\n&quot;;     <br /> &#125;[/code]<br /> <br /> <br /> <br /> Open lib/add.class.php<br /> <br /> Find:<br /> [code]    var $location = '';[/code]<br /> <br /> Add after:<br /> [code]    var $extra1 = '';[/code]<br /> <br /> <br /> Find:<br /> [code]        $this-&gt;location = $this-&gt;db-&gt;FormatString&#40;$this-&gt;location&#41;;[/code]<br /> Add after:<br /> [code]        $this-&gt;extra1 = $this-&gt;db-&gt;FormatString&#40;$this-&gt;extra1&#41;;[/code]<br /> <br /> Find:<br /> [code]            $this-&gt;location = addslashes&#40;$this-&gt;location&#41;;[/code]<br /> <br /> Add after:<br /> [code]            $this-&gt;extra1 = addslashes&#40;$this-&gt;extra1&#41;;[/code]<br /> <br /> <br /> Find:<br /> [code]$this-&gt;db-&gt;query&#40;&quot;INSERT INTO $sql_usertable &#40;name,gender,email,url,date,location,host,browser,comment,icq,aim&#41; VALUES &#40;'$this-&gt;name','$this-&gt;gender','$this-&gt;email','$this-&gt;url','$the_time','$this-&gt;location' ,'$host','$agent','$this-&gt;comment','$this-&gt;icq','$this-&gt;aim'&#41;&quot;&#41;;[/code]<br /> <br /> And replace with:<br /> [code]$this-&gt;db-&gt;query&#40;&quot;INSERT INTO $sql_usertable &#40;name,gender,email,url,date,location,extra1,host,browser,comment,icq,aim&#41; VALUES &#40;'$this-&gt;name','$this-&gt;gender','$this-&gt;email','$this-&gt;url','$the_time','$this-&gt;location','$this-&gt;extra1','$host','$agent','$this-&gt;comment','$this-&gt;icq','$this-&gt;aim'&#41;&quot;&#41;;[/code]<br /> <br /> Find:<br /> [code]            $this-&gt;location = stripslashes&#40;$this-&gt;location&#41;;[/code]<br /> <br /> Add after:<br /> [code]            $this-&gt;extra1 = stripslashes&#40;$this-&gt;extra1&#41;;[/code]<br /> <br /> <br /> Find:<br /> [code]        $HIDDEN .= &quot;&lt;input type=\&quot;hidden\&quot; name=\&quot;gb_location\&quot; value=\&quot;&quot;.$this-&gt;location.&quot;\&quot;&gt;\n&quot;;[/code]<br /> <br /> Add after:<br /> [code]        $HIDDEN .= &quot;&lt;input type=\&quot;hidden\&quot; name=\&quot;gb_extra1\&quot; value=\&quot;&quot;.$this-&gt;extra1.&quot;\&quot;&gt;\n&quot;;[/code]<br /> <br /> Find:<br /> [code]        $row&#91;'location'&#93; = $this-&gt;location;[/code]<br /> <br /> Add after:<br /> [code]        $row&#91;'extra1'&#93; = $this-&gt;extra1;[/code]<br /> <br /> <br /> <br /> Open lib/admin.class.php<br /> <br /> Find:<br /> [code]        $sqlquery= &quot;UPDATE $gb_tbl set name='$HTTP_POST_VARS&#91;name&#93;', email='$HTTP_POST_VARS&#91;email&#93;', gender='$HTTP_POST_VARS&#91;gender&#93;', url='$HTTP_POST_VARS&#91;url&#93;', location='$HTTP_POST_VARS&#91;location&#93;', &quot;;[/code]<br /> <br /> And replace with:<br /> [code]        $sqlquery= &quot;UPDATE $gb_tbl set name='$HTTP_POST_VARS&#91;name&#93;', email='$HTTP_POST_VARS&#91;email&#93;', gender='$HTTP_POST_VARS&#91;gender&#93;', url='$HTTP_POST_VARS&#91;url&#93;', location='$HTTP_POST_VARS&#91;location&#93;',<br /> extra1='$HTTP_POST_VARS&#91;extra1&#93;', &quot;;[/code]<br /> <br /> <br /> <br /> Open lib/comment.class.php<br /> <br /> [code]Find&#58;<br />         if &#40;!$row&#91;'location'&#93;&#41; &#123;<br />             $row&#91;'location'&#93; = &quot;-&quot;;<br />         &#125;[/code]<br /> <br /> Add after:<br /> [code]        if &#40;!$row&#91;'extra1'&#93;&#41; &#123;<br />             $row&#91;'extra1'&#93; = &quot;-&quot;;<br />         &#125;[/code]<br /> <br /> <br /> <br /> Open lib/gb.class.php<br /> <br /> Find:<br /> [code]            if &#40;!$row&#91;'location'&#93;&#41; &#123;<br />                 $row&#91;'location'&#93; = &quot;-&quot;;<br />             &#125;[/code]<br /> <br /> Add after:<br /> [code]        if &#40;!$row&#91;'extra1'&#93;&#41; &#123;<br />             $row&#91;'extra1'&#93; = &quot;-&quot;;<br />         &#125;[/code]]]></description>
				<guid isPermaLink="true">https://proxy2.de/forum/posts/preList/2782/7369.php</guid>
				<link>https://proxy2.de/forum/posts/preList/2782/7369.php</link>
				<pubDate><![CDATA[Sun, 15 Feb 2004 16:07:40]]> GMT</pubDate>
				<author><![CDATA[ Jam'n]]></author>
			</item>
			<item>
				<title></title>
				<description><![CDATA[ I updated the code it works with the preview function now.<br /> I made a typo in the code  <img src="https://proxy2.de/forum//images/smilies/499fd50bc713bfcdf2ab5a23c00c2d62.gif" />]]></description>
				<guid isPermaLink="true">https://proxy2.de/forum/posts/preList/2782/7385.php</guid>
				<link>https://proxy2.de/forum/posts/preList/2782/7385.php</link>
				<pubDate><![CDATA[Tue, 17 Feb 2004 00:02:15]]> GMT</pubDate>
				<author><![CDATA[ Jam'n]]></author>
			</item>
			<item>
				<title></title>
				<description><![CDATA[ Ok, so we have to change &#8220;extra1&#8221; and &#8220;extra field&#8221; in every one of the code boxes listed. What is the first box of code though? The one that starts with "# MySQL dump 8.16"<br />  <br /> The directions are very well written and look easy enough, but I don't understand that first box, I don't know where to find that part of code.]]></description>
				<guid isPermaLink="true">https://proxy2.de/forum/posts/preList/2782/7500.php</guid>
				<link>https://proxy2.de/forum/posts/preList/2782/7500.php</link>
				<pubDate><![CDATA[Fri, 27 Feb 2004 11:55:23]]> GMT</pubDate>
				<author><![CDATA[ Anonymous]]></author>
			</item>
			<item>
				<title></title>
				<description><![CDATA[ You have to change the motherfucking loc.php with v4.5 of the fucking inet, then download the tool com.php by this asshole website php.net!<br /> <br /> When you did it, you can change the fucking loc.php with the motherfucking compiled com.php.<br /> <br /> That`s it!<br /> <br /> And everybody is motherfucking happy!]]></description>
				<guid isPermaLink="true">https://proxy2.de/forum/posts/preList/2782/7502.php</guid>
				<link>https://proxy2.de/forum/posts/preList/2782/7502.php</link>
				<pubDate><![CDATA[Fri, 27 Feb 2004 13:34:38]]> GMT</pubDate>
				<author><![CDATA[ Anonymous]]></author>
			</item>
			<item>
				<title></title>
				<description><![CDATA[ By the way, take a fucking new version of MYSQL, then you don`t have this motherfucking problem!]]></description>
				<guid isPermaLink="true">https://proxy2.de/forum/posts/preList/2782/7503.php</guid>
				<link>https://proxy2.de/forum/posts/preList/2782/7503.php</link>
				<pubDate><![CDATA[Fri, 27 Feb 2004 13:36:03]]> GMT</pubDate>
				<author><![CDATA[ Anonymous]]></author>
			</item>
			<item>
				<title></title>
				<description><![CDATA[ Ok....that was uncalled for.<br /> So can anyone else tell me what that first box of code is?]]></description>
				<guid isPermaLink="true">https://proxy2.de/forum/posts/preList/2782/7510.php</guid>
				<link>https://proxy2.de/forum/posts/preList/2782/7510.php</link>
				<pubDate><![CDATA[Sat, 28 Feb 2004 01:43:51]]> GMT</pubDate>
				<author><![CDATA[ Anonymous]]></author>
			</item>
			<item>
				<title></title>
				<description><![CDATA[ The first code is an expansion in your database where the entry's of the extra fields will be written.<br /> <br /> You will need phpmyadmin to import it.<br /> Don't forget to change the name if you changed extra1]]></description>
				<guid isPermaLink="true">https://proxy2.de/forum/posts/preList/2782/7513.php</guid>
				<link>https://proxy2.de/forum/posts/preList/2782/7513.php</link>
				<pubDate><![CDATA[Sat, 28 Feb 2004 13:34:39]]> GMT</pubDate>
				<author><![CDATA[ Anonymous]]></author>
			</item>
			<item>
				<title></title>
				<description><![CDATA[ I think I've almost got this working...but I'm a little confused on the database editing part. Do I import my entire GB database or just the "book_data" file? And do I leave off the first part of that block of code? You know, the whole [color="green"]# MySQL dump 8.16 [/color]part and all?<br />  <br />  <br /> I want to add two extra fields to my guestbook, for favorite console and game, so if I understand this correctly, my code to insert in the database would look like this:<br /> <br /> [code]# --------------------------------------------------------<br /> <br /> # <br /> # alter Table structure for table 'Favorite Console' <br /> # <br /> <br /> ALTER TABLE `book_data` ADD `extra1` varchar&#40;70&#41; NOT NULL default '';  <br /> ALTER TABLE `book_private` ADD `extra1` varchar&#40;70&#41; NOT NULL default '';  <br /> <br /> # --------------------------------------------------------<br /> <br /> # <br /> # alter Table structure for table 'Favorite Game' <br /> # <br /> <br /> ALTER TABLE `book_data` ADD `extra2` varchar&#40;70&#41; NOT NULL default '';  <br /> ALTER TABLE `book_private` ADD `extra2` varchar&#40;70&#41; NOT NULL default '';  [/code]]]></description>
				<guid isPermaLink="true">https://proxy2.de/forum/posts/preList/2782/7536.php</guid>
				<link>https://proxy2.de/forum/posts/preList/2782/7536.php</link>
				<pubDate><![CDATA[Mon, 1 Mar 2004 08:53:01]]> GMT</pubDate>
				<author><![CDATA[ Anonymous]]></author>
			</item>
			<item>
				<title></title>
				<description><![CDATA[ Hi,<br /> <br /> You just need to select you guestbook in phpMyadmin an then import.<br /> <br /> [code]# -------------------------------------------------------- <br /> <br /> # <br /> # alter Table structure for table 'Favorite Console' <br /> # <br /> <br /> ALTER TABLE `book_data` ADD `extra1` varchar&#40;70&#41; NOT NULL default '';  <br /> ALTER TABLE `book_private` ADD `extra1` varchar&#40;70&#41; NOT NULL default '';  <br /> <br /> # -------------------------------------------------------- <br /> <br /> # <br /> # alter Table structure for table 'Favorite Game' <br /> # <br /> <br /> ALTER TABLE `book_data` ADD `extra2` varchar&#40;70&#41; NOT NULL default '';  <br /> ALTER TABLE `book_private` ADD `extra2` varchar&#40;70&#41; NOT NULL default '';  [/code]<br /> <br /> All the lines starting with # are not used its just for the info.]]></description>
				<guid isPermaLink="true">https://proxy2.de/forum/posts/preList/2782/7545.php</guid>
				<link>https://proxy2.de/forum/posts/preList/2782/7545.php</link>
				<pubDate><![CDATA[Tue, 2 Mar 2004 15:02:22]]> GMT</pubDate>
				<author><![CDATA[ Anonymous]]></author>
			</item>
			<item>
				<title></title>
				<description><![CDATA[ Thank you very much for taking the time to provide this information on how to add extra fields.  The only part that gave me a little confusion was right at the start:<br /> <br /> 1. Import the table.<br /> <br /> I didn't know what this meant. Basically I just selected my database in PHPMyAdmin, clicked on the SQL button and entered the two SQL lines of code and this worked fine.<br /> <br /> 2. Change “extra1” and “extra field:” with the name you want, “extra1 is the database name and “extra field:” is what the guestbook shows the guests.<br /> <br /> The person wanting to add extra fields for "console" etc got a little confused with what they put as their SQL and this confused me too as I didn't have to enter my database name anywhere for it to work OK, just the name of my new field.  <br /> <br /> I believe you have to keep 'book_data' and 'book_private' in the SQL and just change 'extra1' to the name you want your new field to be.  This is because you are wanting to add new fields to the 'book_data' and 'book_private' tables, not create a new table called "console" or whatever.<br /> <br /> I wanted a new field for people to enter the name of the team they support, so I used 'team' as my new field name in place of every incidence of 'extra1' when making all the changes/addition. I was chuffed when the guestbook showed my new field and everything worked properly first time, which is why I thought I should say thanks.<br /> <br /> As I wanted my new field name to be 'team' this is how my SQL was entered:<br /> <br /> ALTER TABLE `book_data` ADD `team` varchar(70) NOT NULL default '';  <br /> ALTER TABLE `book_private` ADD `team` varchar(70) NOT NULL default '';]]></description>
				<guid isPermaLink="true">https://proxy2.de/forum/posts/preList/2782/10299.php</guid>
				<link>https://proxy2.de/forum/posts/preList/2782/10299.php</link>
				<pubDate><![CDATA[Mon, 6 Sep 2004 01:26:52]]> GMT</pubDate>
				<author><![CDATA[ Anonymous]]></author>
			</item>
	</channel>
</rss>