• 0 BookmarksBookmarks
  • 20 RepliesReplies
  • 5389 ReadTimes Read
  • 3 PointsPoints

Topic: Broken Link List

Usuario: FragaCampos
Rango: Nuevo Usuario
Mensajes: 46
Points: 13
Mi web: www.docspt.com
Perfil: View Profile
Pais:
pt
Broken Link List
February 20, 2013 - 05:23 17:23
Hola.

How can I show the visible name of the author of the topic instead of showing the real name in the list and MP?

This is a stupendous mod. Congratulations for this nice job!
Usuario: manix
Rango: User Extremo
Mensajes: 437
Points: 214
Perfil: View Profile
Pais:
cr
Re:Broken Link List
Reply #1 February 21, 2013 - 10:11 10:11
Have you tried to change 'username' instead 'real_name'  ? There are several options, you can try also 'name' in order to show just the user name.
Usuario: FragaCampos
Rango: Nuevo Usuario
Mensajes: 46
Points: 13
Mi web: www.docspt.com
Perfil: View Profile
Pais:
pt
Re:Broken Link List
Reply #2 February 21, 2013 - 12:27 12:27
I already tried to look for those, but the template uses $infor['posterhref'].
I don't know php but I think posterhref is defined has '<a href="'$scripturl .'?action=profile;u='$row['id_member'] .'">'.$row['poster_name'].'</a>';

I don't believe I can change "poster_name" variable...
Usuario: manix
Rango: User Extremo
Mensajes: 437
Points: 214
Perfil: View Profile
Pais:
cr
Re:Broken Link List
Reply #3 February 21, 2013 - 02:19 14:19
Yes, posterhref  is defined at Display.php. When the topic is showed an array of messages (filled by messages info) are created. So, my first recomendation is make use of a function name LoadMemberContext(), for example:


global $memberContext;
loadMemberContext($message['id_member']);
$name $memberContext[$message['id_member']]['name'];
Usuario: FragaCampos
Rango: Nuevo Usuario
Mensajes: 46
Points: 13
Mi web: www.docspt.com
Perfil: View Profile
Pais:
pt
Re:Broken Link List
Reply #4 February 21, 2013 - 03:58 15:58
Ok, but unless you can say exactly how and where I put that, I have no knowledge to do it.  :(
Usuario: manix
Rango: User Extremo
Mensajes: 437
Points: 214
Perfil: View Profile
Pais:
cr
Re:Broken Link List
Reply #5 February 21, 2013 - 04:53 16:53
Ohh apologies!  Well.. let me know where exactly you'd like to change the name? Please provide the screenshots as necessary to understand which files do I need to edit :-)
Usuario: FragaCampos
Rango: Nuevo Usuario
Mensajes: 46
Points: 13
Mi web: www.docspt.com
Perfil: View Profile
Pais:
pt
Re:Broken Link List
Reply #6 February 21, 2013 - 05:08 17:08
Ok, I want to show the visible name like in "FragaCampos" not the real name as in "Fragha".

Thank you.  ;)

Usuario: manix
Rango: User Extremo
Mensajes: 437
Points: 214
Perfil: View Profile
Pais:
cr
Re:Broken Link List
Reply #7 February 21, 2013 - 08:14 20:14
Here we go...

There is a file into the current theme directory named BrokenLinksList.template.php, just search for this line:
',$txt['bll_report_links_poster'],' ', $infor['posterhref'] ,'

and then, edit it to get something like this:
',$txt['bll_report_links_poster'],' ', $infor['reported_name_href'] ,'

Please note that I have replaced the word "posterhref" to "reported_name_href". Let me know if you have any problem about it
Usuario: FragaCampos
Rango: Nuevo Usuario
Mensajes: 46
Points: 13
Mi web: www.docspt.com
Perfil: View Profile
Pais:
pt
Re:Broken Link List
Reply #8 February 21, 2013 - 10:11 22:11
No, that's not what I want...  ::)
What you're doing is substituting post creator name for denouncer name. I want to keep the post creator name, but the visible name, not the real name.

Note that "Fragha" and "FragaCampos" are the same user, but the first name is de post creator and the second is de denouncer.

Hope this makes any sense.
Usuario: manix
Rango: User Extremo
Mensajes: 437
Points: 214
Perfil: View Profile
Pais:
cr
Re:Broken Link List
Reply #9 February 22, 2013 - 12:44 00:44
Hmmm,  yes, you are correct. So, to make it works follow the instructions below>

1. Undo the previous modification

2. At /Sources/BrokenLinksLink.php find:
Code: [Select]
$request = $smcFunc['db_query']('', '
SELECT m.id_topic,m.id_msg,m.id_member,m.subject,m.poster_name,
   br.id_topic, br.id_msg, br.reported_time, br.reported_name, br.status, br.notes, br.id_member_reported, br.id_report
FROM {db_prefix}messages AS m
INNER JOIN {db_prefix}broken_links_list AS br ON (m.id_msg = br.id_msg)
ORDER BY '.$sort_methods[$_REQUEST['sort']][$context['sort_direction']].''
);

and replace the code above by this one:
Code: [Select]
$request = $smcFunc['db_query']('', '
SELECT m.id_topic,m.id_msg,m.id_member,m.subject,m.poster_name, u.real_name,
   br.id_topic, br.id_msg, br.reported_time, br.reported_name, br.status, br.notes, br.id_member_reported, br.id_report
FROM {db_prefix}messages AS m
INNER JOIN {db_prefix}broken_links_list AS br ON (m.id_msg = br.id_msg)
        LEFT JOIN {db_prefix}members as u ON (m.id_member = u.id_member)
ORDER BY '.$sort_methods[$_REQUEST['sort']][$context['sort_direction']].''
);

After that, in the same  file find:
Code: [Select]
$inforows['posterhref'] = '<a href="'. $scripturl .'?action=profile;u='. $row['id_member'] .'">'.$row['poster_name'].'</a>';
And then replace it by:
Code: [Select]
$inforows['posterhref'] = '<a href="'. $scripturl .'?action=profile;u='. $row['id_member'] .'">'.$row['real_name'].'</a>';
Usuario: FragaCampos
Rango: Nuevo Usuario
Mensajes: 46
Points: 13
Mi web: www.docspt.com
Perfil: View Profile
Pais:
pt
Re:Broken Link List
Reply #10 February 22, 2013 - 12:46 12:46
It worked wonderfully!

Thank you very much for you assistance and patience.   ;)
Usuario: manix
Rango: User Extremo
Mensajes: 437
Points: 214
Perfil: View Profile
Pais:
cr
Re:Broken Link List
Reply #11 February 22, 2013 - 01:43 13:43
You are very welcome :-)
Usuario: FragaCampos
Rango: Nuevo Usuario
Mensajes: 46
Points: 13
Mi web: www.docspt.com
Perfil: View Profile
Pais:
pt
Re:Broken Link List
Reply #12 February 22, 2013 - 02:06 14:06
Errr... just one more thing. Now, when I denounce broken links the [1], [2] etc. doesn't appear anymore in the menu button.
It does appear in my localhost test site, but not on my live site.  Can you understand why?
Usuario: manix
Rango: User Extremo
Mensajes: 437
Points: 214
Perfil: View Profile
Pais:
cr
Re:Broken Link List
Reply #13 February 22, 2013 - 02:15 14:15
did it start before or after the changes?
Usuario: FragaCampos
Rango: Nuevo Usuario
Mensajes: 46
Points: 13
Mi web: www.docspt.com
Perfil: View Profile
Pais:
pt
Re:Broken Link List
Reply #14 February 22, 2013 - 02:25 14:25
Well, actually, I made the changes in my localhost, and it's working. Then I installed in my live forum and it's not. So I don't really know if the problem is due to the mod at all...
 

TAGS



top

Smfsimple.com es un sitio destinado a brindar un servicio de soporte y herramientas para foros realizados con el sistema de foros gratuito simplemachines.org. Contamos con un selecto equipo de desarrolladores y conocedores del sistema, sus foros estaran en buenas manos.
This site is not affiliated with or endorsed by Simple Machines