Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

FOP2 Community Forum

  1. Home
  2. Support
  3. Fop 2.11 - Visual Phonebook

Fop 2.11 - Visual Phonebook

Scheduled Pinned Locked Moved Support
9 Posts 3 Posters 48 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M
    M
    Marc
    wrote on last edited by
    #1

    Hey all,

    Hopefully this will be an easy one...when I open the phonebook I am greeted with this:

    "yes") { die("no way"); } if($context=="") { $addcontext=""; } else { $addcontext="${context}_"; } // Sanitize Input $addcontext = ereg_replace("\.[\.]+", "", $addcontext); $addcontext = ereg_replace("^[\/]+", "", $addcontext); $addcontext = ereg_replace("^[A-Za-z][:\|][\/]?", "", $addcontext); $extension = ereg_replace("'", "", $extension ); $extension = ereg_replace("\"", "", $extension ); $extension = ereg_replace(";", "", $extension ); $grid = new dbgrid($db); $grid->set_table('visual_phonebook'); //$grid->set_caption(trans('Manage Phonebook')); $grid->salt("dldli3ks"); $grid->hide_field('id'); $grid->set_per_page(5); $grid->set_condition("context='$context' AND (owner='$extension' OR (owner<>'$extension' AND private='no'))"); $grid->set_default_values("context",$context); $grid->set_default_values("owner",$extension); $grid->set_input_type("context","hidden"); $grid->set_input_type("owner","hidden"); $grid->no_edit_field("context"); $grid->no_edit_field("owner"); $grid->hide_field('context'); $grid->hide_field('owner'); $grid->edit_field_condition("private",'owner','=',$extension); $fieldname = Array(); $fieldname[]=trans('First Name'); $fieldname[]=trans('Last Name'); $fieldname[]=trans('Company'); $fieldname[]=trans('Phone 1'); $fieldname[]=trans('Phone 2'); $fieldname[]=trans('Private'); $fieldname[]=trans('Picture'); //$grid->set_fields ( "id,firstname,lastname,company,phone1,phone2,owner,private,picture"); $grid->set_display_name( array('firstname','lastname','company','phone1','phone2','private','picture'), $fieldname); $grid->allow_view(true); $grid->allow_edit(true); $grid->allow_delete(true); $grid->allow_add(true); $grid->allow_export(true); $grid->allow_import(true); $grid->allow_search(true); $grid->set_search_fields(array('firstname','lastname','company','phone1','phone2')); $grid->set_input_type('picture','img'); //$grid->set_input_type('owner','select',array($extension,'')); $grid->force_import_field("context",$context); $grid->force_import_field("owner",$extension); $grid->add_display_filter('picture','display_image'); //$grid->add_display_filter('owner','display_private'); //$grid->add_edit_filter('owner','display_private'); $grid->set_user_directory('./uploads/'.$addcontext); //$grid->add_validation_type('email','email'); $grid->show_grid(); function display_image($img) { global $addcontext; if(is_file("./uploads/${addcontext}$img")) { return ""; } else { return "n/a"; } } function display_private($owner) { if($owner=="") { return trans('no'); } else { return trans('yes'); } } ?>
    

    Cannot for the life of me work this out. I have put a fresh copy of the html folder up on the server in the hopes that this would fix it however it still shows this message.

    Server is running the following versions of PHP

    PHP Version 5.3.2
    

    This is on a CentOS 5.3 server and it is connecting to a MySQL server on another box.

    Database has been added correctly and the users configured.

    1 Reply Last reply
    0
    • N
      N
      nicolas
      wrote on last edited by
      #2

      In php.ini set short_open_tag = on and restart apache.

      1 Reply Last reply
      0
      • M
        M
        Marc
        wrote on last edited by
        #3

        That worked perfectly. Thanks a lot. 😄

        1 Reply Last reply
        0
        • N
          N
          nicolas
          wrote on last edited by
          #4

          You are welcome, I will use the standard php tags on the next release to avoid this issue. It seems that some newer linux distributions are not enabling short tags for php by default.

          1 Reply Last reply
          0
          • A
            A
            abasic
            wrote on last edited by
            #5

            I have same problem!
            CentOS 5.5
            PHP 5.2.10 (short_open_tag = On)
            FOP 2.20

            1 Reply Last reply
            0
            • N
              N
              nicolas
              wrote on last edited by
              #6

              Hi,

              I do not think you have the same problem. FOP 2.20 does not use short tags anymore. So please explain a little bit better what do you see and what happens. If you see php code when loading the phonebook, then it is probably your web server does not have php support enabled.

              1 Reply Last reply
              0
              • A
                A
                abasic
                wrote on last edited by
                #7

                PHP is enabled i followed instructions on http://wiki.centos.org/HowTos/PHP_5.1_To_5.2, and my test page is fine!

                This is what i get after click on Phonebook link:

                $page_title>\n"; } else { echo " \n"; } ?>
                "yes") { die("no way"); } if($context=="") { $addcontext=""; } else { $addcontext="${context}_"; } // Sanitize Input $addcontext = ereg_replace("\.[\.]+", "", $addcontext); $addcontext = ereg_replace("^[\/]+", "", $addcontext); $addcontext = ereg_replace("^[A-Za-z][:\|][\/]?", "", $addcontext); $extension = ereg_replace("'", "", $extension ); $extension = ereg_replace("\"", "", $extension ); $extension = ereg_replace(";", "", $extension ); $grid = new dbgrid($db); $grid->set_table('visual_phonebook'); //$grid->set_caption(trans('Manage Phonebook')); $grid->salt("dldli3ks"); $grid->hide_field('id'); $grid->set_per_page(5); $grid->set_condition("context='$context' AND (owner='$extension' OR (owner<>'$extension' AND private='no'))"); $grid->set_default_values("context",$context); $grid->set_default_values("owner",$extension); $grid->set_input_type("context","hidden"); $grid->set_input_type("owner","hidden"); $grid->no_edit_field("context"); $grid->no_edit_field("owner"); $grid->hide_field('context'); $grid->hide_field('owner'); $grid->edit_field_condition("private",'owner','=',$extension); $fieldname = Array(); $fieldname[]=trans('First Name'); $fieldname[]=trans('Last Name'); $fieldname[]=trans('Company'); $fieldname[]=trans('Phone 1'); $fieldname[]=trans('Phone 2'); $fieldname[]=trans('Private'); $fieldname[]=trans('Picture'); //$grid->set_fields ( "id,firstname,lastname,company,phone1,phone2,owner,private,picture"); $grid->set_display_name( array('firstname','lastname','company','phone1','phone2','private','picture'), $fieldname); $grid->allow_view(true); $grid->allow_edit(true); $grid->allow_delete(true); $grid->allow_add(true); $grid->allow_export(true); $grid->allow_import(true); $grid->allow_search(true); $grid->set_search_fields(array('firstname','lastname','company','phone1','phone2')); $grid->set_input_type('picture','img'); //$grid->set_input_type('owner','select',array($extension,'')); $grid->force_import_field("context",$context); $grid->force_import_field("owner",$extension); $grid->add_display_filter('picture','display_image'); $grid->add_display_filter('phone1','clickdial'); $grid->add_display_filter('phone2','clickdial'); //$grid->add_display_filter('owner','display_private'); //$grid->add_edit_filter('owner','display_private'); $grid->set_user_directory('./uploads/'.$addcontext); //$grid->add_validation_type('email','email'); $grid->show_grid(); function display_image($img) { global $addcontext; if(is_file("./uploads/${addcontext}$img")) { return ""; } else { return "n/a"; } } function display_private($owner) { if($owner=="") { return trans('no'); } else { return trans('yes'); } } function clickdial($number) { return "$number"; } ?>
                
                1 Reply Last reply
                0
                • N
                  N
                  nicolas
                  wrote on last edited by
                  #8

                  If php is configured correctly and you are looking at fop 2.20 visual phonebook, then it** must** work. From your post it seems you are having php installation issues. I cannot help you much, perhaps you can write a short php file in fop2 directory info.php

                  <?php
                  phpinfo();
                  ?>
                  

                  and see if it works. Perhaps you have mixed php versions installed, or the php.ini file is not in the place you think it should be, or you are loading fop2.11 phonebook and you still do not have short tags enabled.

                  If you see the php info page with the above script, check the location of the php.ini file and the status of short_open_tag

                  1 Reply Last reply
                  0
                  • N
                    N
                    nicolas
                    wrote on last edited by
                    #9

                    Just an idea, perhaps you broke config.php when putting the credentials.. be sure you do not have errors there and that the php tags are present.

                    1 Reply Last reply
                    0

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better 💗

                    Register Login
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    Powered by NodeBB Contributors
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups