Jump to content

Confused


ngreenwood6

Recommended Posts

I am pretty good with php but I am lost trying to figure something out. I am trying to edit a text file. The file has something like this in it:

 

Hello {USERNAME},

 

No where in this file is <?php. I am used to doing echo $username but this just seems odd to me. How does it get this username? I was thinking that it was calling this file from somewhere but I tried searching through all the source files of my site for that txt files name and came up with nothing. Any help is appreciated.

Link to comment
https://forums.phpfreaks.com/topic/157829-confused/
Share on other sites

Well I am using phpbb and there are nothing but text files in this specific folder. They are the emails and messages that you receive. Basically I am trying to make it so that when the person receives an email it sends them what was posted in the email, because right now it is just showing the link to the post. I am in the language folder so its not in the template. Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/157829-confused/#findComment-832466
Share on other sites

Well you don't need to find the render for that. Just set a template variable in the PHP and slap it into the template. :D

 

Just a note - there are many places where phpBB set template variables. Make sure you choose the right place or it won't work. I've had numerous issues when I was getting around phpBB3 for the first time. :D Good times...

Link to comment
https://forums.phpfreaks.com/topic/157829-confused/#findComment-832473
Share on other sites

You'll have to find the correct PHP page that sets the template variables for the template the sends that specific email. And you would just call it with "{SOME_NAME}" where SOME_NAME is defined as a template variable. The { } around it just lets the template system know that is has to do something with it.

Link to comment
https://forums.phpfreaks.com/topic/157829-confused/#findComment-832568
Share on other sites

That is where I set them. I was just showing you the code that I put in there. Here is the whole thing:

 

$messenger->assign_vars(array(
				'USERNAME'		=> htmlspecialchars_decode($addr['name']),
				'TOPIC_TITLE'	=> htmlspecialchars_decode($topic_title),
				'FORUM_NAME'	=> htmlspecialchars_decode($forum_name),

				'U_FORUM'				=> generate_board_url() . "/viewforum.$phpEx?f=$forum_id",
				'U_TOPIC'				=> generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id",
				'U_NEWEST_POST'			=> generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id&p=$post_id&e=$post_id",
				'U_STOP_WATCHING_TOPIC'	=> generate_board_url() . "/viewtopic.$phpEx?uid={$addr['user_id']}&f=$forum_id&t=$topic_id&unwatch=topic",
				'U_STOP_WATCHING_FORUM'	=> generate_board_url() . "/viewforum.$phpEx?uid={$addr['user_id']}&f=$forum_id&unwatch=forum",
				'AUTHOR'	            => htmlspecialchars_decode($user->data['username']),
				'MESSAGETEXT'	        => htmlspecialchars_decode($data['message']),
			));

 

That is showing the author but it is not showing the MESSAGETEXT. I changed it to "hello" instead of the $data['message'] and it showed it. Everywhere through the code it looks like it gets the message by doing $data['message'] but its not showing it

Link to comment
https://forums.phpfreaks.com/topic/157829-confused/#findComment-832615
Share on other sites

I had no intentions of posting the files here. I am drawing a huge blank right now about how to do something. I figured out that the $data was getting passed in through reference for another function in this same file. So I am thinking that because of this it is not available outside of that function. How can I get that data from that function to another function in that file.

Link to comment
https://forums.phpfreaks.com/topic/157829-confused/#findComment-832761
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.