Jump to content

Error on Object Variable for paging


tadisaus2

Recommended Posts

Hello,

I have a dating site. I tried to include a message on the first page to read as "Welcome to our website" on the search results. Here is the code I used:
<?php if ( $this->objval($_obj,'page_links')  == "1") { ?>
<p>Welcome to our website</p>
<?php } ?>

But it didn't work at all.
Can you someone help me please?

Thanks.

Here is a complete code:

<?php global $PREFS, $TEMPLATE, $SESSION;
include_once SYS_PATH . "includes/ext/ext.anchor.php";
include_once SYS_PATH . "includes/ext/core/ext.lang.php";
include_once SYS_PATH . "includes/ext/core/ext.dropdownlist.php";
include_once SYS_PATH . "includes/ext/core/ext.trim.php";
include_once SYS_PATH . "includes/ext/core/ext.ifelse.php";
 ?><?php $_temp_inc = $TEMPLATE->output('header.tpl',0); include($_temp_inc); ?>

<div class="header_wrap">
    <div class="options_wrap">
        <div class="title">
            <ul><li><?php echo vldext_lang("search","app_results"); ?></li></ul>
        </div>        
        <div class="clear"></div>
    </div>
</div>
<?php if ( $this->objval($_obj,'page_links')  == "1") { ?>
<p>Welcome to our website</p>
<?php } ?>
<?php $_temp_inc = $TEMPLATE->output('message.tpl',0); include($_temp_inc); ?>

<?php if ( $this->objval($_obj,'hide_content')  != "1") { ?>
    <div class="outter page_search_results">
        <div class="typemembers">
            <?php if ( @$PREFS->conf['enable_saved_searches']  &&  @$SESSION->conf['can_save_searches'] ) { ?>
                <div class="dataitem single" id="div_save_search" style="display: none">
                    <div class="form">
                        <div class="entry" id="save_search_response">
                            <form name="form_save_search" id="form_save_search" action="" onsubmit="save_search();return false;" method="post">
                                <div class="fieldset">
                                    <dl class="fieldset fieldgrid">
                                        <dt><label for="field_search_save"><?php echo vldext_lang("search","save_search"); ?></label></dt>
                                        <dd><input name="search_save" type="text" class="text" id="field_search_save" style="width: 200px" value="" maxlength="128" /></dd>
                                        <dd class="submit report">
                                            <input id="save_search_submit" class="submit" name="submit" value="<?php echo vldext_lang("search","submit"); ?>" type="submit" />
                                            <div class="progress" id="save_search_progress"></div>
                                            <div class="clear"></div>
                                        </dd>
                                    </dl>
                                    <div class="clear"></div>
                                </div>
                                <input type="hidden" id="field_hash" name="hash" value="<?php echo isset($_obj['search_hash']) ? $_obj['search_hash'] : "{search_hash}"; ?>" />
                            </form>
                        </div>
                    </div>
                </div>
            <?php } ?>
            <div class="dataitem single" id="div_reorder" style="display: none">
                <div class="form">
                    <form name="form_reorder" action="<?php echo isset($_obj['virtual_path']) ? $_obj['virtual_path'] : "{virtual_path}"; ?><?php echo isset($_obj['search_link']) ? $_obj['search_link'] : "{search_link}"; ?>" method="post">
                        <div class="fieldset">
                            <dl class="fieldset fieldgrid">
                                <dt><label for="field_orderby"><?php echo vldext_lang("search","order_by"); ?></label></dt>
                                <dd><select class="select" name="orderby" id="field_orderby"><?php echo vldext_dropdownlist($_obj['orderby_box'],$_obj['search_orderby']); ?></select></dd>
                                <dt><label for="field_direction"><?php echo vldext_lang("search","direction"); ?></label></dt>
                                <dd><select class="select" name="direction" id="field_direction"><?php echo vldext_dropdownlist($_obj['direction_box'],$_obj['search_direction']); ?></select></dd>
                                <dt><label for="field_display_type"><?php echo vldext_lang("search","display_type"); ?></label></dt>
                                <dd><select class="select" name="display_type" id="field_display_type"><?php echo vldext_dropdownlist($_obj['displaytype_box'],$_obj['displaytype']); ?></select></dd>
                                <dd class="submit"><input class="submit" name="submit" value="<?php echo vldext_lang("search","submit"); ?>" type="submit" /></dd>
                            </dl>
                            <div class="clear"></div>
                        </div>
                    </form>
                </div>
            </div>
            <?php if ( $this->objval($_obj,'displaytype')  == "1") { ?>
                <div class="dataitem single gallerybox">
                    <?php if (!empty($_obj['search_profiles'])){ if (!is_array($_obj['search_profiles'])) $_obj['search_profiles']=array(array('search_profiles'=>$_obj['search_profiles'])); $_tmp_arr_keys=array_keys($_obj['search_profiles']); if ($_tmp_arr_keys[0]!='0') $_obj['search_profiles']=array(0=>$_obj['search_profiles']); $_stack[$_stack_cnt++]=$_obj; $_cnt['search_profiles']=count($_obj['search_profiles']); foreach ($_obj['search_profiles'] as $rowcnt=>$search_profiles) { $search_profiles['rowcnt']=$rowcnt; $search_profiles['rowpos']=$rowcnt+1; $search_profiles['rownum']=$rowcnt%2+1; $search_profiles['rowtotal']=$_cnt['search_profiles']; $search_profiles['rowfirst']=$rowcnt==0?1:0; $search_profiles['rowlast']=($rowcnt+1)==$_cnt['search_profiles']?1:0; $_obj=&$search_profiles; ?>
                        <div class="image">
                            <?php $_temp_inc = $TEMPLATE->output('member_sections_picture.tpl',0); include($_temp_inc); ?>
                            <ul><li><a href="<?php echo isset($_stack[0]['virtual_path']) ? $_stack[0]['virtual_path'] : "{virtual_path}"; ?><?php echo isset($_obj['member_profile_link']) ? $_obj['member_profile_link'] : "{member_profile_link}"; ?>"><?php echo vldext_trim($_obj['member_username'],; ?>, <?php echo isset($_obj['profile_field_age_value_years']) ? $_obj['profile_field_age_value_years'] : "{profile_field_age_value_years}"; ?></a></li></ul>
                        </div>
                    <?php } $_obj=$_stack[--$_stack_cnt];} ?>
                    <div class="clear"></div>
                </div>
                <div class="clear"></div>
            <?php } else { ?>
                <?php if (!empty($_obj['search_profiles'])){ if (!is_array($_obj['search_profiles'])) $_obj['search_profiles']=array(array('search_profiles'=>$_obj['search_profiles'])); $_tmp_arr_keys=array_keys($_obj['search_profiles']); if ($_tmp_arr_keys[0]!='0') $_obj['search_profiles']=array(0=>$_obj['search_profiles']); $_stack[$_stack_cnt++]=$_obj; $_cnt['search_profiles']=count($_obj['search_profiles']); foreach ($_obj['search_profiles'] as $rowcnt=>$search_profiles) { $search_profiles['rowcnt']=$rowcnt; $search_profiles['rowpos']=$rowcnt+1; $search_profiles['rownum']=$rowcnt%2+1; $search_profiles['rowtotal']=$_cnt['search_profiles']; $search_profiles['rowfirst']=$rowcnt==0?1:0; $search_profiles['rowlast']=($rowcnt+1)==$_cnt['search_profiles']?1:0; $_obj=&$search_profiles; ?>
                    <div class="dataitem <?php echo vldext_ifelse($_obj['rownum'],"1","odd","even"); ?> <?php echo vldext_ifelse($_obj['rowlast'],"1","dataitemlast",""); ?>">
                        <table class="plain">
                            <tr>
                                <td>
                                    <div class="image">
                                        <?php $_temp_inc = $TEMPLATE->output('member_sections_picture.tpl',0); include($_temp_inc); ?>
                                    </div>
                                </td>
                                <td class="data">
                                    <div class="datainfo">
                                        <?php $_temp_inc = $TEMPLATE->output('member_sections_name.tpl',0); include($_temp_inc); ?>
                                        <dl class="datainfo">
                                            <?php $_temp_inc = $TEMPLATE->output('member_sections_card.tpl',0); include($_temp_inc); ?>
                                        </dl>
                                    </div>
                                </td>
                                <td>
                                    <div class="actions">
                                        <ul class="actions">
                                            <?php $_temp_inc = $TEMPLATE->output('member_sections_quick_actions.tpl',0); include($_temp_inc); ?>
                                        </ul>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="3">
                                <div> <?php echo vldext_trim($_obj['profile_field_inmyownwords_value'],300); ?></div>
                                </td>
                            </tr>
                        </table>
                    </div>
                <?php } $_obj=$_stack[--$_stack_cnt];} ?>
            <?php } ?>
        </div>
        <div class="clear"></div>

    </div>

    <?php if ( $this->objval($_obj,'total_pages')  > "1") { ?>
        <div class="footer_wrap">
            <div class="footer">
                <p><?php echo vldext_lang("search","page_numbers"); ?></p>
                <?php echo isset($_obj['page_links']) ? $_obj['page_links'] : "{page_links}"; ?>
                <div class="clear"></div>
            </div>
        </div>
        <div class="clear"></div>
    <?php } ?>

<?php } ?>

<?php $_temp_inc = $TEMPLATE->output('footer.tpl',0); include($_temp_inc); ?>
Link to comment
Share on other sites

First off, it certainly doesn't look like this is a method within an object, so $this doesn't point to anything. Other than that, we've really no way of telling because none of the code you've posted contains the logic. It's all display, so we can't see what objval() is expecting or is expected to return. Turn on error reporting by placing the following at the top of your script and see what that has to say.

error_reporting(-1);
ini_set('display_errors',true);

In fact, you reference $this->objval() in several places - are any of them working? Because, again, this doesn't appear to be a method of an object.

Link to comment
Share on other sites

There is no error but it didn't work. I mean, when I view the site, it doesn't show that text on Pages 1.

the last block of code:

    <?php if ( $this->objval($_obj,'total_pages')  > "1") { ?>
        <div class="footer_wrap">
            <div class="footer">
                <p><?php echo vldext_lang("search","page_numbers"); ?></p>
                <?php echo isset($_obj['page_links']) ? $_obj['page_links'] : "{page_links}"; ?>
                <div class="clear"></div>
            </div>
        </div>
        <div class="clear"></div>
    <?php } ?>

 

Shows the pages as:

Pages

1 2 ...

 

How can I change to show that text on the Page 1?

 

Thanks.

Link to comment
Share on other sites

change your code to this....

 

<?php global $PREFS, $TEMPLATE, $SESSION;
include_once SYS_PATH . "includes/ext/ext.anchor.php";
include_once SYS_PATH . "includes/ext/core/ext.lang.php";
include_once SYS_PATH . "includes/ext/core/ext.dropdownlist.php";
include_once SYS_PATH . "includes/ext/core/ext.trim.php";
include_once SYS_PATH . "includes/ext/core/ext.ifelse.php";
 ?><?php $_temp_inc = $TEMPLATE->output('header.tpl',0); include($_temp_inc); ?>

<div class="header_wrap">
    <div class="options_wrap">
        <div class="title">
            <ul><li><?php echo vldext_lang("search","app_results"); ?></li></ul>
        </div>        
        <div class="clear"></div>
    </div>
</div>
<?php if ( ( int ) $_obj['page_links'] == 1 ) { ?>
<p>Welcome to our website</p>
<?php } ?>
<?php $_temp_inc = $TEMPLATE->output('message.tpl',0); include($_temp_inc); ?>

<?php if ( ( int ) $_obj['hide_content']  != 1) { ?>
    <div class="outter page_search_results">
        <div class="typemembers">
            <?php if ( @$PREFS->conf['enable_saved_searches']  &&  @$SESSION->conf['can_save_searches'] ) { ?>
                <div class="dataitem single" id="div_save_search" style="display: none">
                    <div class="form">
                        <div class="entry" id="save_search_response">
                            <form name="form_save_search" id="form_save_search" action="" onsubmit="save_search();return false;" method="post">
                                <div class="fieldset">
                                    <dl class="fieldset fieldgrid">
                                        <dt><label for="field_search_save"><?php echo vldext_lang("search","save_search"); ?></label></dt>
                                        <dd><input name="search_save" type="text" class="text" id="field_search_save" style="width: 200px" value="" maxlength="128" /></dd>
                                        <dd class="submit report">
                                            <input id="save_search_submit" class="submit" name="submit" value="<?php echo vldext_lang("search","submit"); ?>" type="submit" />
                                            <div class="progress" id="save_search_progress"></div>
                                            <div class="clear"></div>
                                        </dd>
                                    </dl>
                                    <div class="clear"></div>
                                </div>
                                <input type="hidden" id="field_hash" name="hash" value="<?php echo isset($_obj['search_hash']) ? $_obj['search_hash'] : "{search_hash}"; ?>" />
                            </form>
                        </div>
                    </div>
                </div>
            <?php } ?>
            <div class="dataitem single" id="div_reorder" style="display: none">
                <div class="form">
                    <form name="form_reorder" action="<?php echo isset($_obj['virtual_path']) ? $_obj['virtual_path'] : "{virtual_path}"; ?><?php echo isset($_obj['search_link']) ? $_obj['search_link'] : "{search_link}"; ?>" method="post">
                        <div class="fieldset">
                            <dl class="fieldset fieldgrid">
                                <dt><label for="field_orderby"><?php echo vldext_lang("search","order_by"); ?></label></dt>
                                <dd><select class="select" name="orderby" id="field_orderby"><?php echo vldext_dropdownlist($_obj['orderby_box'],$_obj['search_orderby']); ?></select></dd>
                                <dt><label for="field_direction"><?php echo vldext_lang("search","direction"); ?></label></dt>
                                <dd><select class="select" name="direction" id="field_direction"><?php echo vldext_dropdownlist($_obj['direction_box'],$_obj['search_direction']); ?></select></dd>
                                <dt><label for="field_display_type"><?php echo vldext_lang("search","display_type"); ?></label></dt>
                                <dd><select class="select" name="display_type" id="field_display_type"><?php echo vldext_dropdownlist($_obj['displaytype_box'],$_obj['displaytype']); ?></select></dd>
                                <dd class="submit"><input class="submit" name="submit" value="<?php echo vldext_lang("search","submit"); ?>" type="submit" /></dd>
                            </dl>
                            <div class="clear"></div>
                        </div>
                    </form>
                </div>
            </div>
            <?php if ( ( int ) $_obj['displaytype'] == 1) { ?>
                <div class="dataitem single gallerybox">
                    <?php if (!empty($_obj['search_profiles'])){ if (!is_array($_obj['search_profiles'])) $_obj['search_profiles']=array(array('search_profiles'=>$_obj['search_profiles'])); $_tmp_arr_keys=array_keys($_obj['search_profiles']); if ($_tmp_arr_keys[0]!='0') $_obj['search_profiles']=array(0=>$_obj['search_profiles']); $_stack[$_stack_cnt++]=$_obj; $_cnt['search_profiles']=count($_obj['search_profiles']); foreach ($_obj['search_profiles'] as $rowcnt=>$search_profiles) { $search_profiles['rowcnt']=$rowcnt; $search_profiles['rowpos']=$rowcnt+1; $search_profiles['rownum']=$rowcnt%2+1; $search_profiles['rowtotal']=$_cnt['search_profiles']; $search_profiles['rowfirst']=$rowcnt==0?1:0; $search_profiles['rowlast']=($rowcnt+1)==$_cnt['search_profiles']?1:0; $_obj=&$search_profiles; ?>
                        <div class="image">
                            <?php $_temp_inc = $TEMPLATE->output('member_sections_picture.tpl',0); include($_temp_inc); ?>
                            <ul><li><a href="<?php echo isset($_stack[0]['virtual_path']) ? $_stack[0]['virtual_path'] : "{virtual_path}"; ?><?php echo isset($_obj['member_profile_link']) ? $_obj['member_profile_link'] : "{member_profile_link}"; ?>"><?php echo vldext_trim($_obj['member_username'], ; ?>, <?php echo isset($_obj['profile_field_age_value_years']) ? $_obj['profile_field_age_value_years'] : "{profile_field_age_value_years}"; ?></a></li></ul>
                        </div>
                    <?php } $_obj=$_stack[--$_stack_cnt];} ?>
                    <div class="clear"></div>
                </div>
                <div class="clear"></div>
            <?php } else { ?>
                <?php if (!empty($_obj['search_profiles'])){ if (!is_array($_obj['search_profiles'])) $_obj['search_profiles']=array(array('search_profiles'=>$_obj['search_profiles'])); $_tmp_arr_keys=array_keys($_obj['search_profiles']); if ($_tmp_arr_keys[0]!='0') $_obj['search_profiles']=array(0=>$_obj['search_profiles']); $_stack[$_stack_cnt++]=$_obj; $_cnt['search_profiles']=count($_obj['search_profiles']); foreach ($_obj['search_profiles'] as $rowcnt=>$search_profiles) { $search_profiles['rowcnt']=$rowcnt; $search_profiles['rowpos']=$rowcnt+1; $search_profiles['rownum']=$rowcnt%2+1; $search_profiles['rowtotal']=$_cnt['search_profiles']; $search_profiles['rowfirst']=$rowcnt==0?1:0; $search_profiles['rowlast']=($rowcnt+1)==$_cnt['search_profiles']?1:0; $_obj=&$search_profiles; ?>
                    <div class="dataitem <?php echo vldext_ifelse($_obj['rownum'],"1","odd","even"); ?> <?php echo vldext_ifelse($_obj['rowlast'],"1","dataitemlast",""); ?>">
                        <table class="plain">
                            <tr>
                                <td>
                                    <div class="image">
                                        <?php $_temp_inc = $TEMPLATE->output('member_sections_picture.tpl',0); include($_temp_inc); ?>
                                    </div>
                                </td>
                                <td class="data">
                                    <div class="datainfo">
                                        <?php $_temp_inc = $TEMPLATE->output('member_sections_name.tpl',0); include($_temp_inc); ?>
                                        <dl class="datainfo">
                                            <?php $_temp_inc = $TEMPLATE->output('member_sections_card.tpl',0); include($_temp_inc); ?>
                                        </dl>
                                    </div>
                                </td>
                                <td>
                                    <div class="actions">
                                        <ul class="actions">
                                            <?php $_temp_inc = $TEMPLATE->output('member_sections_quick_actions.tpl',0); include($_temp_inc); ?>
                                        </ul>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="3">
                                <div> <?php echo vldext_trim($_obj['profile_field_inmyownwords_value'],300); ?></div>
                                </td>
                            </tr>
                        </table>
                    </div>
                <?php } $_obj=$_stack[--$_stack_cnt];} ?>
            <?php } ?>
        </div>
        <div class="clear"></div>

    </div>

    <?php if ( ( int ) $_obj['total_pages'] > 1) { ?>
        <div class="footer_wrap">
            <div class="footer">
                <p><?php echo vldext_lang("search","page_numbers"); ?></p>
                <?php echo isset($_obj['page_links']) ? $_obj['page_links'] : "{page_links}"; ?>
                <div class="clear"></div>
            </div>
        </div>
        <div class="clear"></div>
    <?php } ?>

<?php } ?>

<?php $_temp_inc = $TEMPLATE->output('footer.tpl',0); include($_temp_inc); ?>

Edited by printf
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.