[campsite-users] Search function
  • _______________________________________________
    campsite-users mailing list
    campsite-users@lists.campware.org
    http://lists.campware.org/mailman/listinfo/campsite-users
  • 18 Comments sorted by
  • _______________________________________________
    campsite-users mailing list
    campsite-users@lists.campware.org
    http://lists.campware.org/mailman/listinfo/campsite-users
  • Hi Mark,

    You do not have to do anything special during installation to get
    search capability working as it should.
    Did you get some error or it just does not work?

    I just tried in a fresh installation and I was able to search in the
    demo templates without any problem.

    Best,


    On Fri, Oct 10, 2008 at 10:01 PM, Mark Corsi wrote:
    > Guys - I must have missed a step during install. How do i get the search
    > function to work on the default template?
    >
    >
    >
    >
    > Mark Corsi
    >
    >
    >
    > Thanks to TV and for the convenience of TV, you can only be one of two kinds
    > of human beings, either a liberal or a conservative.
    > - Kurt Vonnegut
    >
    >
    >
    >
    > _______________________________________________
    > campsite-users mailing list
    > campsite-users@lists.campware.org
    > http://lists.campware.org/mailman/listinfo/campsite-users
    >



    --
    /holman
    _______________________________________________
    campsite-users mailing list
    campsite-users@lists.campware.org
    http://lists.campware.org/mailman/listinfo/campsite-users
  • Hi Mark,

    You can order articles by article names, something like this:

    {{ list_articles order="byName" }}
    {{ $campsite->article->name }}

    {{ /list_articles }}

    Hope this helps, and do not hesitate in "spamming" us with some more
    questions Wink

    Best,



    On Sat, Oct 11, 2008 at 6:00 AM, Mark Corsi wrote:
    > Sorry - another question (or two)....
    >
    > Please allow me to explain why I am bombarding y'all with questions.
    >
    > One of my clients is a very small financial newsletter company that has 5
    > on-line publications. I spent
    > a lot of time researching content management solutions for them about 6
    > months ago and
    > I ended up recommending Campsite as the very best of breed solution for
    > their needs.
    >
    > They decided 2 weeks ago to move forward with the project. Consequently, I
    > am trying to get their publications
    > into 'campsite' databases as quickly as possible.
    >
    > The first one to launch is a free site. Last night I was able to import ~
    > 700 individual stock/company profiles (as articles) into the
    > database, however I have not found a template that will help me organize
    > these profiles well. Does anyone have
    > a template which will alphabetize article names and display them?
    >
    > Also, I can't seem to get the search function to work. For the the first
    > site launch, I am modifying the default template site
    > which can be imported during the initial campsite configuration/build. Does
    > anyone know how to get the search
    > function in the upper right hand quadrant working"?
    >
    > Also, if the company (Spear Publications) does not strenuously object, I am
    > planning on leaving the 'powered by campsite' text beneath their footer. Is
    > there anything else the campware.org team would like me to do in order to
    > help recognize their work? (Please understand it
    > can not be very intrusive, but if I can help give you guys credit for your
    > hard work, I am more than happy to.)
    >
    > Once again, I apologize for spamming this list, but unless someone complains
    > directly - I believe I am going
    > to have to continue to ask frequent questions for the next few weeks/months
    > while I transition this client's 5 publications into
    > campsite.
    >
    > Thanks for all the help!
    >
    > Mark Corsi
    >
    >
    >
    > _______________________________________________
    > campsite-users mailing list
    > campsite-users@lists.campware.org
    > http://lists.campware.org/mailman/listinfo/campsite-users
    >



    --
    /holman
    _______________________________________________
    campsite-users mailing list
    campsite-users@lists.campware.org
    http://lists.campware.org/mailman/listinfo/campsite-users
  • _______________________________________________
    campsite-users mailing list
    campsite-users@lists.campware.org
    http://lists.campware.org/mailman/listinfo/campsite-users
  • _______________________________________________
    campsite-users mailing list
    campsite-users@lists.campware.org
    http://lists.campware.org/mailman/listinfo/campsite-users
  • _______________________________________________
    campsite-users mailing list
    campsite-users@lists.campware.org
    http://lists.campware.org/mailman/listinfo/campsite-users
  • _______________________________________________
    campsite-users mailing list
    campsite-users@lists.campware.org
    http://lists.campware.org/mailman/listinfo/campsite-users
  • _______________________________________________
    campsite-users mailing list
    campsite-users@lists.campware.org
    http://lists.campware.org/mailman/listinfo/campsite-users
  • _______________________________________________
    campsite-users mailing list
    campsite-users@lists.campware.org
    http://lists.campware.org/mailman/listinfo/campsite-users
  • i think you need to use the double brackets. like {{php}} and {{/php}}. not 100% sure, but quick to try.

    all the best,

    micz


    >
    > The manual points me to a page on smarty.net. Smarty tells me to
    > embed it as so:
    >
    > {php}
    > // including a php script directly from the template.
    > include('/path/to/display_weather.php');
    > {/php}
    >
    >
    > When I do that, the page displays the code (including tags) as if it
    > was simply text i wanted to display (I added the red for clarity):
    >
    >
    > Home > Spear Publications > First issue > Profiles >
    >
    >
    >
    >
    >
    >
    > {php} print "it worked."; {/php}
    >
    >
    > - - 2006-10-27
    >
    >
    > - - 2006-11-03
    >
    >
    > - - 2006-11-10
    >
    >
    > (TASR - Taser International - 2007-05-25
    >
    >
    > A - Agilent - 2006-04-28
    >
    >
    > AAPL - Apple - 2007-01-12
    >
    >
    > AAPL - Apple Computer - 2004-06-11
    >
    >
    > AAPL - Apple Computer - 2005-04-08 ___________________________________
    > ____________ campsite-users mailing list campsite-users@lists.
    > campware.org http://lists.campware.org/mailman/listinfo/campsite-
    >
    > users


    _______________________________________________
    campsite-users mailing list
    campsite-users@lists.campware.org
    http://lists.campware.org/mailman/listinfo/campsite-users
  • Hi Mark,

    Yes, as Micz just said, you need to use the double brackets.
    You can use either a custom template function, or:
    {{ include_php file="path/to/your/file.php" }}

    ... too, especially when you do not want to include many php lines in
    your templates.

    This double bracket rule applies for all smarty tags, we just
    re-defined the delimiters to work this way in Campsite.


    Best,


    On Mon, Oct 13, 2008 at 2:23 PM, Mark Corsi wrote:
    > The manual points me to a page on smarty.net. Smarty tells me to embed it as
    > so:
    >
    > {php}
    > // including a php script directly from the template.
    > include('/path/to/display_weather.php');
    > {/php}
    >
    >
    > When I do that, the page displays the code (including tags) as if it was
    > simply text i wanted to display (I added the red for clarity):
    >
    > Home > Spear Publications > First issue > Profiles >
    >
    > {php} print "it worked."; {/php}
    >
    > - - 2006-10-27
    >
    > - - 2006-11-03
    >
    > - - 2006-11-10
    >
    > (TASR - Taser International - 2007-05-25
    >
    > A - Agilent - 2006-04-28
    >
    > AAPL - Apple - 2007-01-12
    >
    > AAPL - Apple Computer - 2004-06-11
    >
    > AAPL - Apple Computer - 2005-04-08
    >
    > _______________________________________________
    > campsite-users mailing list
    > campsite-users@lists.campware.org
    > http://lists.campware.org/mailman/listinfo/campsite-users
    >



    --
    /holman
    _______________________________________________
    campsite-users mailing list
    campsite-users@lists.campware.org
    http://lists.campware.org/mailman/listinfo/campsite-users
  • Thanks guys -

    That worked - should have thought of that.

    Still need to resolve this search functionality issue. Simply will not work
    other than the tiny bit I have desribed.

    My guees is that you have it working on many other sites so I really don't
    know where to start my debugging. It is not throwing error messages. It
    simply does not work for any other search term but the first used (after a
    dump of the index database and a reindex) and that search term takes 3 mins
    to produce a result.

    Ok - I am sure we are going to solve that one. On to other things...

    Holman - I need to write a function for this site that displays an
    alphebetized methodology of searching for articles:

    ie - links that looks like:


    a | b | c | d |e | f


    and if you click on a letter - beneath those links will pop up all the
    articles that start with that letter. (or, if there are a more than 1000
    articles it might start to go: aa -ak | al-az | etc....

    The articles profile stocks which means if we had every company covered, we
    would need 8K+ profiles for the New York Stock Exchange alone (and the
    writers do cover other exchanges, just not very often). You can obviously
    see how this listing could quickly become quite cumbersome.

    Deciding the break point may have to be either hard coded or an admin thing.
    I am just now learning your back end, so I am not sure which it should be.


    As far as I can see, I need to write my own php code that wraps around your
    tags:

    ie (and don't shoot me for the code here; been at it 18 hours and I just
    want to bang out the idea with you. ... This is going to be real pseudo
    code:



    {{ list_articles order="byName asc" }}

    // This line is a little muddled - but I think you get my
    drift:

    {{php}} $assoc_array[ {{/php}} {{ $campsite->article->name }}
    {{php}}] = {{/php}} {{ uri options="article" }} {{php}} ; {{/php}}

    {{ /list_articles }}

    After done storing the variables throw the array into a session and
    the rest of the pages can be generated dynamically from it
    {{php}}
    $_SESSION['assoc_array'] = $assoc_array;

    Then in order to get the listing for the "A's" page,
    list all the $_SESSION['assoc_array']['KEYS'] that begin with the
    letter 'a' etc...
    {{/php}}

    Thinks something like this is doable? Do you think this approach is the best
    way to do it?

    Mark











    -----Original Message-----
    From: campsite-users-bounces@netfinity-4.mdlf.org
    [mailto:campsite-users-bounces@netfinity-4.mdlf.org] On Behalf Of Holman
    Romero
    Sent: Monday, October 13, 2008 8:57 PM
    To: Mailing-list for all campsite users.
    Subject: Re: [campsite-users] Hoiw do I embed php code?

    Hi Mark,

    Yes, as Micz just said, you need to use the double brackets.
    You can use either a custom template function, or:
    {{ include_php file="path/to/your/file.php" }}

    ... too, especially when you do not want to include many php lines in your
    templates.

    This double bracket rule applies for all smarty tags, we just re-defined the
    delimiters to work this way in Campsite.


    Best,


    On Mon, Oct 13, 2008 at 2:23 PM, Mark Corsi wrote:
    > The manual points me to a page on smarty.net. Smarty tells me to embed
    > it as
    > so:
    >
    > {php}
    > // including a php script directly from the template.
    > include('/path/to/display_weather.php');
    > {/php}
    >
    >
    > When I do that, the page displays the code (including tags) as if it
    > was simply text i wanted to display (I added the red for clarity):
    >
    > Home > Spear Publications > First issue > Profiles >
    >
    > {php} print "it worked."; {/php}
    >
    > - - 2006-10-27
    >
    > - - 2006-11-03
    >
    > - - 2006-11-10
    >
    > (TASR - Taser International - 2007-05-25
    >
    > A - Agilent - 2006-04-28
    >
    > AAPL - Apple - 2007-01-12
    >
    > AAPL - Apple Computer - 2004-06-11
    >
    > AAPL - Apple Computer - 2005-04-08
    >
    > _______________________________________________
    > campsite-users mailing list
    > campsite-users@lists.campware.org
    > http://lists.campware.org/mailman/listinfo/campsite-users
    >



    --
    /holman
    _______________________________________________
    campsite-users mailing list
    campsite-users@lists.campware.org
    http://lists.campware.org/mailman/listinfo/campsite-users

    _______________________________________________
    campsite-users mailing list
    campsite-users@lists.campware.org
    http://lists.campware.org/mailman/listinfo/campsite-users
  • Is there anyway to clear/reset the admin password from the mysql server. If
    not, are there any tools to do this if the password has been lost?

    _______________________________________________
    campsite-users mailing list
    campsite-users@lists.campware.org
    http://lists.campware.org/mailman/listinfo/campsite-users
  • Log in to the mysql server, either via the console or some admin
    interface such as PhpMyAdmin and run this SQL sentence:

    UPDATE liveuser_users SET Password = SHA1('the_new_password') WHERE
    UName = 'admin';



    On Tue, Oct 14, 2008 at 10:06 AM, Mark Corsi wrote:
    > Is there anyway to clear/reset the admin password from the mysql server. If
    > not, are there any tools to do this if the password has been lost?
    >
    > _______________________________________________
    > campsite-users mailing list
    > campsite-users@lists.campware.org
    > http://lists.campware.org/mailman/listinfo/campsite-users
    >



    --
    /holman
    _______________________________________________
    campsite-users mailing list
    campsite-users@lists.campware.org
    http://lists.campware.org/mailman/listinfo/campsite-users
  • _______________________________________________
    campsite-users mailing list
    campsite-users@lists.campware.org
    http://lists.campware.org/mailman/listinfo/campsite-users
  • sorry holman, I missed this post.

    How do I define/create a custom template function? Is there a
    tutorial/directions on it.

    In other words, there is a function that gives me access too certain article
    attributes in alphabetical order that goes like:

    {{ list_articles order="byName asc" }}

    from this I can get the locations of articles, {{ uri options="article" }} ;
    the names, {{ $campsite->article->name }} ... etc ... etc...


    I realize you know all this, but I am trying to sum up my understanding so
    you understand the limits of my knowledge.


    Now, let's say I want to only display articles that begin with the letter
    'a'. The only way I can see of doing something like this is to pipe the
    campsite feed into some php code like:

    {{ list_articles order="byName asc" }}

    {{php}}
    if (preg_match('/^(a|A).*/',{{/php}} {{
    $campsite->article->name }} {{php}} ){ {{/php}}

    {{ $campsite->article->name }}



    {{ php }} } {{/php}}

    {{ /list_articles }}

    ----------- I threw this code together quickly for the an example and it
    doesn't run - crashes with this error:

    [Sat Oct 25 03:36:21 2008] [error] [client 192.168.1.200] PHP Parse error:
    syntax error, unexpected ';' in
    /var/www/campsite/templates_c/%%B4^B45^B4563F92%%section-content-profiles.tp
    l.php on line 14, referer: http://staging.spearreport.local/
    ----------------

    Since there is no ';' on line 14 this exemplifies my whole point. Developing
    stuff like this is very, very unwieldy. The interweaving {{php}} {{/php}}
    tags makes it very hard to follow/debug the code.

    Since this is a nearly trivial example of what I need to do, it would be
    much better for my needs to simply rewrite or expand the functionality of
    the campsite tags.

    How hard is this and can you give me a brief introduction of where to find
    the code to be modified. In other words, where does the list_articles
    method/function reside etc....


    -----Original Message-----
    From: campsite-users-bounces@netfinity-4.mdlf.org
    [mailto:campsite-users-bounces@netfinity-4.mdlf.org] On Behalf Of Holman
    Romero
    Sent: Monday, October 13, 2008 8:57 PM
    To: Mailing-list for all campsite users.
    Subject: Re: [campsite-users] Hoiw do I embed php code?

    Hi Mark,

    Yes, as Micz just said, you need to use the double brackets.
    You can use either a custom template function, or:
    {{ include_php file="path/to/your/file.php" }}

    ... too, especially when you do not want to include many php lines in your
    templates.

    This double bracket rule applies for all smarty tags, we just re-defined the
    delimiters to work this way in Campsite.


    Best,


    On Mon, Oct 13, 2008 at 2:23 PM, Mark Corsi wrote:
    > The manual points me to a page on smarty.net. Smarty tells me to embed
    > it as
    > so:
    >
    > {php}
    > // including a php script directly from the template.
    > include('/path/to/display_weather.php');
    > {/php}
    >
    >
    > When I do that, the page displays the code (including tags) as if it
    > was simply text i wanted to display (I added the red for clarity):
    >
    > Home > Spear Publications > First issue > Profiles >
    >
    > {php} print "it worked."; {/php}
    >
    > - - 2006-10-27
    >
    > - - 2006-11-03
    >
    > - - 2006-11-10
    >
    > (TASR - Taser International - 2007-05-25
    >
    > A - Agilent - 2006-04-28
    >
    > AAPL - Apple - 2007-01-12
    >
    > AAPL - Apple Computer - 2004-06-11
    >
    > AAPL - Apple Computer - 2005-04-08
    >
    > _______________________________________________
    > campsite-users mailing list
    > campsite-users@lists.campware.org
    > http://lists.campware.org/mailman/listinfo/campsite-users
    >



    --
    /holman
    _______________________________________________
    campsite-users mailing list
    campsite-users@lists.campware.org
    http://lists.campware.org/mailman/listinfo/campsite-users

    _______________________________________________
    campsite-users mailing list
    campsite-users@lists.campware.org
    http://lists.campware.org/mailman/listinfo/campsite-users
  • BTW - Got a little closer on this issue but hit a wall.

    This code tries to work:

    #############################################################

    {{ list_articles order="byName asc" }}

    {{php}}
    $patterns[0] = '/\'/';
    $patterns[1] = '/\"/';
    $patterns[2] = '/\;/';
    $replacements[2] = " ";
    $replacements[1] = "'";
    $replacements[0] = "'";
    $string = "{{/php}}{{ $campsite->article->name }}{{php}}";

    $myString = preg_replace($patterns,$replacements,$string);

    if (preg_match("/A/i",$myString,$matches)){
    print ($string); ///////// this is just a test line
    {{/php}}

    {{ $campsite->article->name }}

    {{php}} } {{/php}}

    {{ /list_articles }}


    ########################################################################

    but for some reason the only thing this line produces

    $string = "{{/php}}{{ $campsite->article->name }}{{php}}";


    for a value for $string is:

    ?>article->name;

    Simply will not process the campsite call for some reason even though I can
    get it to process 7 lines below with:

    {{/php}}

    {{ $campsite->article->name }}

    {{php}} }



    Also don't understand why it interprets '{{ $campsite-' to be '?'

    Anyhow - bagging it for the night. Nearly 6 am here.

    If anyone has a better way of approaching this stuff, I will appreciate your
    input.

    Thanks -

    Mark



    -----Original Message-----
    From: campsite-users-bounces@netfinity-4.mdlf.org
    [mailto:campsite-users-bounces@netfinity-4.mdlf.org] On Behalf Of Holman
    Romero
    Sent: Monday, October 13, 2008 8:57 PM
    To: Mailing-list for all campsite users.
    Subject: Re: [campsite-users] Hoiw do I embed php code?

    Hi Mark,

    Yes, as Micz just said, you need to use the double brackets.
    You can use either a custom template function, or:
    {{ include_php file="path/to/your/file.php" }}

    ... too, especially when you do not want to include many php lines in your
    templates.

    This double bracket rule applies for all smarty tags, we just re-defined the
    delimiters to work this way in Campsite.


    Best,


    On Mon, Oct 13, 2008 at 2:23 PM, Mark Corsi wrote:
    > The manual points me to a page on smarty.net. Smarty tells me to embed
    > it as
    > so:
    >
    > {php}
    > // including a php script directly from the template.
    > include('/path/to/display_weather.php');
    > {/php}
    >
    >
    > When I do that, the page displays the code (including tags) as if it
    > was simply text i wanted to display (I added the red for clarity):
    >
    > Home > Spear Publications > First issue > Profiles >
    >
    > {php} print "it worked."; {/php}
    >
    > - - 2006-10-27
    >
    > - - 2006-11-03
    >
    > - - 2006-11-10
    >
    > (TASR - Taser International - 2007-05-25
    >
    > A - Agilent - 2006-04-28
    >
    > AAPL - Apple - 2007-01-12
    >
    > AAPL - Apple Computer - 2004-06-11
    >
    > AAPL - Apple Computer - 2005-04-08
    >
    > _______________________________________________
    > campsite-users mailing list
    > campsite-users@lists.campware.org
    > http://lists.campware.org/mailman/listinfo/campsite-users
    >



    --
    /holman
    _______________________________________________
    campsite-users mailing list
    campsite-users@lists.campware.org
    http://lists.campware.org/mailman/listinfo/campsite-users

    _______________________________________________
    campsite-users mailing list
    campsite-users@lists.campware.org
    http://lists.campware.org/mailman/listinfo/campsite-users
  • _______________________________________________
    campsite-users mailing list
    campsite-users@lists.campware.org
    http://lists.campware.org/mailman/listinfo/campsite-users