Page 2 of 2

Re: Stopping Submissions With Empty Fields

Posted: Wed Oct 05, 2011 4:41 pm
by Henrie
Hello cAdams,

That you 'tricked' me was not meant seriously. Because you made the file available, you 'tricked' me because I was curious.

In this forum thread you have not mentioned before that you are a PHP virgin, but now I know, so I will take it into account.
Finally your suggested modifications haven't worked but thank you for trying all the same and my apologies for wanting to know exactly which image someone is referring to when leaving feedback.
What I suggested were not modifications. These are parts that are literally present in the gbook.php file. The parts and functions I mentioned need to be modified for the guestbook to be able to store the ititle entry in the database.
Because I have no time to modify the code myself I thought I would help you by pointing you in the right direction to make the modifications yourself. I did not know that you were a complete PHP newbie and would not know what to do at all. My apologies that you misunderstood my previous post.

But this is a good way to learn PHP, I learned PHP by modifying GBook to my needs many years ago. Before that I had only used HTML and javascript myself. And the extra field was just a small part of my modifications at that time, so the 2 days is only a guess. I spent 3 weeks of my summer vacation and some more time modifying the guestbook to my needs.

And to clarify for you, the database is not a real database like a MySQL database. It is a txt-file in which all the information is stored, which is also often called a flat file database. In the standard gbook it is named entries.txt. That is where all the entries of the guestbook are stored. You can view it yourself by opening it in a program like notepad or a similar program.

Greetings,
Henrie

Re: Stopping Submissions With Empty Fields

Posted: Fri Oct 07, 2011 9:46 am
by cAdams
given the suffix of the entries file is txt Henrie and one of my websites using My SQL, i knew the entries file isn't a MySQL database file from the beginning :wink:

what i don't know thou' is......
Be carefull where you put the field, it is very important because the fields depend on their order in the text database. Make sure it is added in the text database after the REMOTE_ADDR field.


exactly where does my new ititle (image title) field go in the text file then??? i've worked 14hrs solid on php today and it's now 11:21pm so i'm not thinking straight anymore. adding ititle after the REMOTE_aDDR field only incurs an error message with a blank screen and no matter where i add it otherwise, ititle won't carry over to the entries.txt file

also where you made the suggestion:

function printSign($name='',$from='',$email='',$url='',$comments='',$nosmileys='',$isprivate='',$error='',$spamanswer='')
{
...
}

as line 1044 of gbook.php reads:

function printSign($name='',$from='',$email='',$url='',$ititle='',$comments='',$nosmileys='',$isprivate='',$error='',$spamanswer='')
{
global $settings, $myfield, $lang;
$url=$url ? $url : 'http://';

the sign guestbook page still returns the same image title error message to submit nothing after entering a seemingly relevant url address :(

Re: Stopping Submissions With Empty Fields

Posted: Sat Oct 08, 2011 11:06 pm
by Henrie
Hello cAdams,

Because I am expecting many more questions from you before you get it implemented by yourself. And because I really appreciate you putting a lot of effort in it to do it yourself, I posted the full modifications needed in the following post viewtopic.php?p=16072#p16072 (because the subject of the thread is more fitting and thus making it easier to find for others).

I hope you will succeed now.

Greetings,
Henrie.

Re: Stopping Submissions With Empty Fields

Posted: Sun Oct 09, 2011 12:21 pm
by cAdams
thank you so much for posting the full modifications where they are more appropriately located Henrie :)

however, unfortunately the modifications aren't working. we're getting closer but not quite and i've explained why here