Author Topic: Showing text and/of table only to the owner of the Profile page  (Read 22856 times)

0 Members and 1 Guest are viewing this topic.

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: Showing text and/of table only to the owner of the Profile page
« Reply #15 on: November 10, 2007, 10:40:32 PM »
I can not use it because the tweak of today you have to typ the name of the user
Quote
{if user_loggedin_username} and {endif user_loggedin_username}. Replace username with true user name.
but what I want on the member_profile.html is:

If user ID info is match with user ID profile (same ID) = show the table:
Quote
<table width="100%" border="0" cellspacing="0" cellpadding="1">
  <tr>
    <td valign="top" class="head2">
      ***some text here***
    </td>
  </tr>
</table><br /><br />

If not: Show nothing (Hide the table).

Try please to TWEAK (change) this code:
Quote
"user_loggedin_" . $user_info['user_name'] => (isset($user_info['user_name']) && !empty(format_text(trim($user_info['user_name'])), 2) && $user_info['user_level'] >= USER) ? true : false,

I know that you want to help me and I know also that you are busy with other codes. So please take your time to read my request to understand what I want.
This time I explain it very very good! :wink:
« Last Edit: November 10, 2007, 11:12:01 PM by cruxy »

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: Showing text and/of table only to the owner of the Profile page
« Reply #16 on: November 10, 2007, 10:46:53 PM »
I could use the tweak of today if I can use {user_ID} in your code on the page_header.php. Something like:

if user_loggedin_{user_id}} and {endif user_loggedin_{user_id}},
but it is NOT possible. :x

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Showing text and/of table only to the owner of the Profile page
« Reply #17 on: November 10, 2007, 11:23:55 PM »
Quote
***some text here***

// Step 1

In member.php file,

find:

Quote
"lang_profile_of" => $lang['profile_of'],

add after:

Code: [Select]
"lang_text_for_each_user" => (isset($user_row[$user_table_fields['user_id']]) && $user_row[$user_table_fields['user_id']] == $user_info['user_id']) ? preg_replace("/" . $site_template->start . "user_name"  . $site_template->end . "/siU", format_text(trim($user_row[$user_table_fields['user_id']]), 2), $lang['text_for_each_user']) : "",

// Step 2

In lang/english/main.php file,

on top ?>:

Code: [Select]
$lang['text_for_each_user'] = "This is text for <b>{user_name}</b>";

Edit text in lang.

// Step 3

In templates/your_template/member_profile.html file,

find:

Quote
***some text here***

replace:

Code: [Select]
{lang_text_for_each_user}

Finish.

Note: If have problem with tweak - please post in correct topic :!:
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: Showing text and/of table only to the owner of the Profile page
« Reply #18 on: November 10, 2007, 11:34:30 PM »
Thanks for the code!

Why are you still talking about text and NOT about table.
I want to hide/show table, NOT A TEXT!

Not
Quote
***some text here***

I want to hide/show the hole table:
Quote
<table width="100%" border="0" cellspacing="0" cellpadding="1">
  <tr>
    <td valign="top" class="head2">
      ***some text here***
    </td>
  </tr>
</table><br /><br />


Oke, Listen: How can I use the same code to hide/show a TABLE instead of text.
Please i need to use {if...} {andif...} otherwise I can not use it with tables. :cry:

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Showing text and/of table only to the owner of the Profile page
« Reply #19 on: November 10, 2007, 11:38:22 PM »
For table, you use: {if user_loggedin} and {endif user_loggedin} ...

Is for user level ...
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: Showing text and/of table only to the owner of the Profile page
« Reply #20 on: November 10, 2007, 11:49:08 PM »
Do you mean that I have first to use:

Quote
***some text here***

// Step 1

In member.php file,

find:

Quote
"lang_profile_of" => $lang['profile_of'],

add after:

Code: [Select]
"lang_text_for_each_user" => (isset($user_row[$user_table_fields['user_id']]) && $user_row[$user_table_fields['user_id']] == $user_info['user_id']) ? preg_replace("/" . $site_template->start . "user_name"  . $site_template->end . "/siU", format_text(trim($user_row[$user_table_fields['user_id']]), 2), $lang['text_for_each_user']) : "",

// Step 2

In lang/english/main.php file,

on top ?>:

Code: [Select]
$lang['text_for_each_user'] = "This is text for <b>{user_name}</b>";

Edit text in lang.

// Step 3

In templates/your_template/member_profile.html file,

find:

Quote
***some text here***

replace:

Code: [Select]
{lang_text_for_each_user}

Finish.

Note: If have problem with tweak - please post in correct topic :!:

en then

Quote
For table, you use: {if user_loggedin} and {endif user_loggedin}

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Showing text and/of table only to the owner of the Profile page
« Reply #21 on: November 10, 2007, 11:56:05 PM »
If use my step 1-2-3 of code - you no need for use {if ... and {endif ... but if use tag, you need for add each user individual with tweak but if use step 1-2-3, query is check for match user ID current with profile user ID. If match, you use {lang_text_for_each_user} .

So do like this:

Code: [Select]
{if lang_text_for_each_user}{lang_text_for_each_user}{endif lang_text_for_each_user}

in member_profile.html file.

all tag register to $site_template->register_vars is match with IF and ENDIF tag. ;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: Showing text and/of table only to the owner of the Profile page
« Reply #22 on: November 11, 2007, 12:38:23 AM »
Hi,
I just test your code step 1-2-3, but {lang_text_for_each_user} is not showing.

There is something wrong with this code I think:
Quote
"lang_text_for_each_user" => (isset($user_row[$user_table_fields['user_id']]) && $user_row[$user_table_fields['user_id']] == $user_info['user_id']) ? preg_replace("/" . $site_template->start . "user_name"  . $site_template->end . "/siU", format_text(trim($user_row[$user_table_fields['user_id']]), 2), $lang['text_for_each_user']) : "",

Can you see what wrong here? :?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Showing text and/of table only to the owner of the Profile page
« Reply #23 on: November 11, 2007, 12:51:21 AM »
Replace code:

Code: [Select]
"lang_text_for_each_user" => (isset($user_row[$user_table_fields['user_id']]) && $user_row[$user_table_fields['user_id']] == $user_info['user_id']) ? preg_replace("/" . $site_template->start . "user_name"  . $site_template->end . "/siU", format_text(trim($user_row[$user_table_fields['user_id']]), 2), $lang['text_for_each_user']) : $lang['text_for_fun'],

In lang/english/main.php file,

in top ?>:

Code: [Select]
$lang['text_for_fun'] = "This is text for fun !";

Is show now :?:
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: Showing text and/of table only to the owner of the Profile page
« Reply #24 on: November 11, 2007, 01:29:49 AM »
I am still testing it. Nothing is showing, but I want first to try more tricks before going back to you and als to be sure about the result.
Later :)

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Showing text and/of table only to the owner of the Profile page
« Reply #25 on: November 11, 2007, 01:32:37 AM »
Ok so remove IF and ENDIF of this lang in member_profile.html file.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: Showing text and/of table only to the owner of the Profile page
« Reply #26 on: November 11, 2007, 02:29:25 AM »
No good niews  :x

I used
Code: [Select]
{lang_text_for_fun} on member_profile.html and

Code: [Select]
    "lang_text_for_each_user" => (isset($user_row[$user_table_fields['user_id']]) && $user_row[$user_table_fields['user_id']] == $user_info['user_id']) ? preg_replace("/" . $site_template->start . "user_name"  . $site_template->end . "/siU", format_text(trim($user_row[$user_table_fields['user_id']]), 2), $lang['text_for_each_user']) : $lang['text_for_fun'],

and
Code: [Select]
$lang['text_for_fun'] = "This is text for fun !"; in main.php
But nothing is showing yet

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Showing text and/of table only to the owner of the Profile page
« Reply #27 on: November 11, 2007, 02:31:17 AM »
In member.php file,

replace this:

Code: [Select]
"lang_text_for_each_user" => (isset($user_row[$user_table_fields['user_id']]) && $user_row[$user_table_fields['user_id']] == $user_info['user_id']) ? preg_replace("/" . $site_template->start . "user_name"  . $site_template->end . "/siU", format_text(trim($user_row[$user_table_fields['user_name']]), 2), $lang['text_for_each_user']) : $lang['text_for_fun'],
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: Showing text and/of table only to the owner of the Profile page
« Reply #28 on: November 11, 2007, 02:37:44 AM »
Nope, nothing is showing yet :(

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Showing text and/of table only to the owner of the Profile page
« Reply #29 on: November 11, 2007, 02:39:37 AM »
And you place code in showprofile action and no editprofile action in member.php file ?
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?