Author Topic: User-Homepage-Link on detail.html  (Read 12277 times)

0 Members and 1 Guest are viewing this topic.

Offline mato72

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
    • Brick-Cinema
User-Homepage-Link on detail.html
« on: January 15, 2008, 02:20:13 AM »
Hallo, ich habe wieder mal ein Problem welches ich nicht alleine Lösen kann.
Ich möchte, wenn man sich auf der detail.html befinden einen Link zur Homepage des jeweiligen Users erstellen lassen.
Wenn der User also eine Homepage HAT, dann möchte ich neben den E-Cards-/Downloads-Buttons einen Button haben der zur Homepage des Users verlinkt.
Wie geht das, ich hab´s schon über Umwege der member_profile versucht, aber das hat alles nix gebracht.

Hi there...
I have a problem, and I need help, because I cant do it myself.
How to make that there will be shown an "Users-Homepage-Button" next to the E-Card/Download-Button on details.html...
I still tryed it though the member_profile, but no solution.....
Please help me...

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: User-Homepage-Link on detail.html
« Reply #1 on: January 15, 2008, 02:57:44 AM »
I like. Is very good request. :)

1 - Install this: http://www.4homepages.de/forum/index.php?topic=19297.0

1.1 - In details.php file,

find:

Code: [Select]
get_user_table_field(", u.", "user_email")."

replace:

Code: [Select]
get_user_table_field(", u.", "user_email"). get_user_table_field(", u.", "user_homepage") . "

2 - In includes/functions.php file,

find:

Code: [Select]
else {
    $user_name = format_text($lang['userlevel_guest'], 2);
    $user_name_link = $user_name;
  }

add after:

Code: [Select]
if (isset($image_row[$user_table_fields['user_homepage']]) && !empty($image_row[$user_table_fields['user_homepage']])) {
   $user_homepage_link = "<a href=\"" . format_url($image_row[$user_table_fields['user_homepage']]) . "\" target=\"_blank\"><img src=\"" . get_gallery_image("user_homepage_link.gif") . "\" border=\"0\"></a>";
}

find:

Code: [Select]
"user_name_link" => $user_name_link,

add after:

Code: [Select]
"user_homepage_link" => (isset($user_homepage_link) && !empty($user_homepage_link)) ? $user_homepage_link : false,

3 - In templates/your_template/details.html file,

add after E-Cart/Download button:

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

4 - In templates/your_template/images - create image: user_homepage_link.gif . ;)

Note: I add in my site too. :)
« Last Edit: January 16, 2008, 01:48:22 PM by thunderstrike »
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 mato72

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
    • Brick-Cinema
Re: User-Homepage-Link on detail.html
« Reply #2 on: January 15, 2008, 04:22:33 AM »
Sorry, not working.... :cry:

I tryed it much times step by step....
No link shown in the user-detail-field (on detail.html) and no link next the buttons....

But no Errors, thats the good thing... ;)

Somewhere there must be an issue...
In Member-Profil the homepage-text-link is shown, but with
{if user_homepage}{user_homepage}{endif user_homepage}.
I tryed to take this code to the new field in details.html and next the buttons, but nothing happens too...

What´s wrong??? May be it´s not possible to show the users homepage elsewhere...???
I use 1.7.4. my page is www.brick-cinema.com


But:
THANK YOU VERRY MUCH for the quick help....!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: User-Homepage-Link on detail.html
« Reply #3 on: January 15, 2008, 04:36:45 AM »
Quote
{if user_homepage}{user_homepage}{endif user_homepage}.

This is no right ... I say:

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

in step ...
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 mato72

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
    • Brick-Cinema
Re: User-Homepage-Link on detail.html
« Reply #4 on: January 15, 2008, 04:43:42 AM »
Quote
Quote
{if user_homepage}{user_homepage}{endif user_homepage}.

This is no right ... I say:

Code:

{if user_homepage_link}{user_homepage_link}{endif user_homepage_link}


in step ...

Yes yes, sorry, you missunderstood me...
I made it LIKE YOU wrote!
But, no result. So I searched other ways too...
It´s still like you wrote me - in all Steps.
I tried this much times, again and again from beginning - but its stil not working....
Mus I crate some DB-Tables in DataBase???

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: User-Homepage-Link on detail.html
« Reply #5 on: January 15, 2008, 04:44:39 AM »
Ok so ... if no error is show ... what is do ?
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 mato72

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
    • Brick-Cinema
Re: User-Homepage-Link on detail.html
« Reply #6 on: January 15, 2008, 04:51:37 AM »
What is do...
What especially you mean???? :roll:
I really have no Idea why it´s not working :cry:
I did it step by step...

Is this mod working with "old" users too or just with "new" users
An especially DB-Field dont needed? ( Don´t know....)

If you wish I can send you the functions and details.php/html, so you can may be take a look in there...

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: User-Homepage-Link on detail.html
« Reply #7 on: January 15, 2008, 04:52:49 AM »
No DB fields need for create ...

Is upload user enter URL in profile ? If no show, is possible no URL is use. ;)
MOD is work only if say URL in member edit profile of user upload. ;)
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 mato72

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
    • Brick-Cinema
Re: User-Homepage-Link on detail.html
« Reply #8 on: January 15, 2008, 05:00:28 AM »
Quote
Is upload user enter URL in profile ? If no show, is possible no URL is use. Wink
MOD is work only if say URL in member edit profile of user upload. Wink

That´s why I tried the other code I wrote you before - because the Url IS SHOWING im memer-profil
So I thought that may be the code has an issue. I thought, when this code:
Code: [Select]
{if user_homepage}{user_homepage}{endif user_homepage}.works in member-profil it must be work in details.html too!
But its not working.... (why -  its working in memer_profile???)

What can I do now?
Other solutions?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: User-Homepage-Link on detail.html
« Reply #9 on: January 15, 2008, 05:16:17 AM »
Hum ... I think is error in fix ...

in includes/functions.php file,

if change:

Code: [Select]
if (isset($additional_user_fields) && is_array($additional_user_fields) && !empty($additional_user_fields)) {
      $additional_field_array = array();
      foreach ($additional_user_fields as $key => $val) {
        $additional_field_array[$key] = (isset($user_info[$key]) && !empty($user_info[$key])) ? format_text(trim($user_info[$key]), 2) : REPLACE_EMPTY;
        $additional_field_array['lang_'.$key] = $val[0];
      }
      if (isset($additional_field_array) && is_array($additional_field_array) && !empty($additional_field_array)) {
        $site_template->register_vars($additional_field_array);
      }
}

for:

Code: [Select]
if (isset($additional_user_fields) && is_array($additional_user_fields) && !empty($additional_user_fields)) {
      $additional_field_array = array();
      foreach ($additional_user_fields as $key => $val) {
        $additional_field_array[$key] = (isset($image_row[$key]) && !empty($image_row[$key])) ? format_text(trim($image_row[$key]), 1) : REPLACE_EMPTY;
        $additional_field_array['lang_'.$key] = $val[0];
      }
      if (isset($additional_field_array) && is_array($additional_field_array) && !empty($additional_field_array)) {
        $site_template->register_vars($additional_field_array);
      }
}

and try:

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

in detail page ... is work right ?
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 mato72

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
    • Brick-Cinema
Re: User-Homepage-Link on detail.html
« Reply #10 on: January 16, 2008, 01:23:24 AM »
No..not working...

So, are you shure that the solution is in function.php???

I searched the code, and in an original function.php there is nothing to finde like "user_homepage"...
That means, that the member-profil dont need an entry in function.php - or I think wrong????

Through this Idea I tryed to search the member-profil WHY there the homepage-link works.
it´s near the code you wrote last time, but its not working.
The question is WHY its not working in detail.html, but im member_profil.html...???
I dont now much of php, so I´m not shure that my try-and-error-method was helpfull (Its not, I know, because its not working... ;) )

But Im shure that the Link down in funtion.php:
"user_homepage_link" => (isset($user_homepage_link) && !empty($user_homepage_link)) ? $user_homepage_link : false,
cant be working. the _LINK is not defined in the code you wrote last time....

Hm...
Brain-Demage....

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: User-Homepage-Link on detail.html
« Reply #11 on: January 16, 2008, 04:01:30 AM »
I miss one step.

In details.php file,

find:

Code: [Select]
get_user_table_field(", u.", "user_email")."

replace:

Code: [Select]
get_user_table_field(", u.", "user_email"). get_user_table_field(", u.", "user_homepage") . "

Is why is no work for you but for me. I fix first post. ;)
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 mato72

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
    • Brick-Cinema
Re: User-Homepage-Link on detail.html
« Reply #12 on: January 16, 2008, 11:38:00 AM »
Quiete COOL!!!
it works...

But just ONE thing I miss:
target="_blank" and
border"0"

Ho to make without parse-error?
If I make it so:
if (isset($image_row[$user_table_fields['user_homepage']]) && !empty($image_row[$user_table_fields['user_homepage']])) {
   $user_homepage_link = "<a href=\"" . format_url($image_row[$user_table_fields['user_homepage']]) . "\"target="_blank"><img src=\"" . get_gallery_image("user_homepage_link.gif") . "\"></a>";
}


its not working...

But I think its better when the Users Homepage is open "blank", so the gallery stays open...

THANK ALOT!!!!!!!!!!!!!!!!!!!!
« Last Edit: January 16, 2008, 11:56:42 AM by mato72 »

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: User-Homepage-Link on detail.html
« Reply #13 on: January 16, 2008, 01:04:17 PM »
Quote
But I think its better when the Users Homepage is open "blank", so the gallery stays open...

First post edit.
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 mato72

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
    • Brick-Cinema
Re: User-Homepage-Link on detail.html
« Reply #14 on: January 16, 2008, 01:31:22 PM »
Ok, understand HOW its work...
But have to be like THIS:
if (isset($image_row[$user_table_fields['user_homepage']]) && !empty($image_row[$user_table_fields['user_homepage']])) {
   $user_homepage_link = "<a href=\"" . format_url($image_row[$user_table_fields['user_homepage']]) . "\" target=\"_blank\"><img src=\"" . get_gallery_image("user_homepage_link.gif") . "\"border=\"0\"></a>";
}


Otherwise the border will be stay...

Thanks alot!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1