1,001

(40 replies, posted in Programming)

I must be missing something here. big_smile What is the difference between using the fulltext search, and just searching a string of several words using the LIKE command?, as is used at the moment?

1,002

(40 replies, posted in Programming)

elbekko wrote:

Because it's in FULLTEXT, which is only supported for MySQL.

So does that relate specifically to the search cache/index tables themselves, then, and not searching the db directly as in the multibyte? method.

So it could just be down to cookies that were created before the pun_setcookie function, (and associated functions),  were updated?

Edit: I've just logged in and out of the various forums, and I don't seem to be triggering it. smile

1,004

(1 replies, posted in PunBB 1.2 troubleshooting)

You can't. smile The search function works on each word separately, as is.

Just wondering if anyone might be able to shed light on how to track this down. Occasionally, and I've not been able to find exactly what triggers it yet, I get this message in the server logs:

(mod_fastcgi.c.2570) FastCGI-stderr: PHP Notice:  Undefined offset:  2 in include/functions.php on line 44

I'm running with E_ALL in PHP with regards to error notices, to track down any possible typo's or such which may exist, and this is the only thing which I haven't been able to sort yet. big_smile Line 44 in functions.php is:

list($cookie['user_id'], $cookie['password_hash'], $cookie['group_id']) = @unserialize($_COOKIE[$cookie_name]);

Modified cookie setup to store the group id in the cookie, but the code has been altered throughout PunBB to reflect that, so there shouldn't be a mismatch in that regard anywhere, that I know of. Any suggestions greatly appreciated. This one is doing my nut in. big_smile


Cheers,

Matt

1,006

(40 replies, posted in Programming)

Jansson wrote:

The use of quotation marks is supported in 1.3 with MySQL.

MySQL only, or PgSQL too? I would have thought that would be down to input parsing rather than db type.

1,007

(5 replies, posted in Programming)

Just wanted to say thanks for the pointer on how to do this Smartys. smile It's made life so much easier now with the new method.

1,008

(40 replies, posted in Programming)

Glad you like it. smile

The beauty of it is the fact that very little extra code is needed, and all it does is use the multibyte method of searching, so nothing changes with regards to how the search function works. Plus, one still has the option of doing searches the old fashioned way. big_smile

1,009

(40 replies, posted in Programming)

Go to the search page and enter these two words in the keywords box: 'web application'

With the box unchecked, you will get three results. With the box checked, you will get one result. smile

1,010

(40 replies, posted in Programming)

Well, once I figured out the search cache/table was killing the full string searches, big_smile it seems I have a working one for testing with. big_smile It needs one extra entry in lang/[language]/search.php:

'Search full'   =>    'Search for the complete string as entered. [ If not selected, each word entered will be searched for separately. ]',

and here's the link to the file:

http://outgoing.bauchan.org/unix/search.txt


I've only given it a quick test, but it appears to be working as expected. big_smile If the full string checkbox isn't selected/ticked, it defaults back to the standard way of searching.

1,011

(40 replies, posted in Programming)

I'll get one knocked together. big_smile

1,012

(11 replies, posted in PunBB 1.2 troubleshooting)

Oops. I never noticed that trailing slash missing. big_smile Must admit, I always use the <img ... /> method.

1,013

(40 replies, posted in Programming)

A checkbox is less code to work on. big_smile Just tried the checkbox method on the downloads search script, and it seems to work rather well. smile http://forums.bauchan.org/testforum/dsearch.php There are only two items in that section, but try the term 'http download' with and without the box checked.

Would anybody be interested in having a modified search.php done to play around with and test for this full string search?

1,014

(40 replies, posted in Programming)

Can't fault that reasoning. big_smile

Would it not be a worthwhile addition, however, to the search function, to make an option in the search box, (i.e: if someone can remember a snippet from a thread, and they wish to hone the search), would it not be better to have a checkbox that would do a full string search only, if selected, and a split keyword search if not?

1,015

(40 replies, posted in Programming)

In the search.php script, the words entered into the search box are split and each one searched separately from the db, as standard, are they not? From what I can see, nowhere within search.php is a db query done upon the single, complete string entered into the search box as is, (as a whole), or have I missed something somewhere?

Alter the two queries in include/functions which set the pun_user array to fetch the info from your table as well as the user table. Personally, I'd create a separate array and leave the pun_user array and db query as is, but the choice is yours.

1,017

(40 replies, posted in Programming)

Just answering my own question here. big_smile T'would appear it works fine. Quick question though, if I might? How come a full string search has never been added into the search function, as well as the individual keyword search? It only appears to require an extra four or five lines of code, to do a simple implode and straight lookup on the full string as entered.

1,018

(11 replies, posted in PunBB 1.2 troubleshooting)

I believe they were debating the placement, i.e: src alt versus alt src.

http://punbb.org/docs/dev.html#integration

1,020

(40 replies, posted in Programming)

Just wondering whether it would be plausible to implement a full string option to the search as well the keywords loop? Had a quick look at search.php, and just wondered if where this occurs:

while (list($i, $word) = @each($keywords_array))

if actually doing a separate query with the keywords, (imploded into a single string), would actually work, or would the existing db lookup throw a wobbler? big_smile


Thanks again,

Matt

1,021

(5 replies, posted in Programming)

I feel such a muppet now you've pointed it out. I've been head scratching for a couple of hours over this, and the penny just never dropped that it could be that simple. big_smile

Thanks ever so much Smartys. smile

1,022

(5 replies, posted in Programming)

Yet another of my wayward questions. smile Is there a simple way to, (for example with the langfiles), create a master array, along the lines of:

$lang = array(

'common'                =>      $lang_dir.'common.php',
'delete'                =>      $lang_dir.'delete.php',
'userlist'              =>      $lang_dir.'userlist.php',

);

        foreach ($lang as $key => $langfile)
        {
                [Create the above array from the contents of this $langfile];
        }

so that they could be referenced as:

$lang['common']['index']

rather than:

$lang_common['index']

?

Would it be a case of removing the array command from those files and reading them in to achieve it, or is there another, more straight forward method? Also, would the above actually work okay? big_smile


Cheers,

Matt

Cheers. smile The arrays are always one area that I've found somewhat mystic so far. Their logic defies me at the moment to a degree. big_smile

Thanks again for the explanation. smile

Elbekko, mind if I brainpick over that code? big_smile

Firstly, does this line:

$userinfo[$cur_feed['rssfeed']] = $cur_feed;

fetch the items from the db info, and then place them into an array of the likes of:

$userinfo[the feed url][id]
$userinfo[the feed url][firstname]
$userinfo[the feed url][username]
$userinfo[the feed url][rssfeed]

?

Secondly, this line:

$info = $userinfo[$item->feed->feed_url];

How exactly does that item->feed->feed_url bit work? Is that a key as stored in the first_items array, or other?

Just trying to broaden my grasp of the multi-dimensional arrays. smile These devils have always eluded me thus far. big_smile


Cheers,

Matt

I've edited that code I posted above. Not sure if it'll make any difference, but give it a whirl. smile

Edit: I've just given it a second edit to move the $xi lower in the loop.