criat Posted November 7, 2013 Share Posted November 7, 2013 Someone knows how to do it? As far as I know the ticket reply is called trough this smarty variable in viewticket.tpl: {$reply.message} I need to edit that /\ Thanks! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 7, 2013 Share Posted November 7, 2013 bonus marks for the sentiment in the image! it's simple to remove most of what you ask - apart from the actual IP address number (the hidden part in your image). the IP address isn't passed as a variable to the template, nor is it stored in the db separately, but it's added to the ticket message by whmcs - so I think you'd have to do a regex search on the message, pull the IP address into a variable and then you could use it... or alternatively, use a hook to remove the last couple lines from ticket messages. 0 Quote Link to comment Share on other sites More sharing options...
criat Posted November 7, 2013 Author Share Posted November 7, 2013 My hosting company uses WHMCS and they removed it Any way to interact with {$reply.message} to remove it or something? I don't know about hooks and such, would take ages for me to learn and come up with a fix 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 7, 2013 Share Posted November 7, 2013 My hosting company uses WHMCS and they removed it i'd be tempted to say ask them how they did it and, if they tell you, share it with the rest of us! Any way to interact with {$reply.message} to remove it or something? I don't know about hooks and such, would take ages for me to learn and come up with a fix I don't know about writing hooks either... no doubt, one day i'll have to play with them... but that day is not upon me yet! one thing that you need to understand is that {$xxx} is not necessarily a simple variable, it can be assembled from any number of separate variables, strings etc - so when it gets called by the template, the individual parts may not be available to us and we're effectively just trying to tweak the output (which has limits). however, try replacing {$reply.message} in viewticket.tpl with... {$reply.message|replace:'----------------------------':''|regex_replace:'/IP Address: (\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))$/':''} this works for me locally. 0 Quote Link to comment Share on other sites More sharing options...
criat Posted November 7, 2013 Author Share Posted November 7, 2013 It affects only ----------------------- IP Adress: 000.000.000 ? Won't that hide numbers in the ticket message itself? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 7, 2013 Share Posted November 7, 2013 errr.... you didn't think to test it yourself before posting? *sighs* no it will not hide numbers, it will not hide IP addresses - but yes, if a customer is foolish enough to use the *exact* phrase "IP Address: xxx.xxx.xxx.xxx" in their ticket, then it will get removed... but short of running a hacked version of WHMCS, it's probably the best solution you're going to find! 0 Quote Link to comment Share on other sites More sharing options...
criat Posted November 7, 2013 Author Share Posted November 7, 2013 Hehe, sorry bro Thanks for your help, really. I couldn't do it without your help 0 Quote Link to comment Share on other sites More sharing options...
criat Posted November 7, 2013 Author Share Posted November 7, 2013 Sorry for the trouble brian, but I'm trying to remove the remaining <br> codes that remains there, here's my try: {$reply.message|replace:'----------------------------':''|regex_replace:'/IP Address: (\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))$/':''|regex_replace:'/<br><br><br>$/':''} Didn't work though, lol Actual ticket coding: <div class="internalpadding clientmsg"> Let's go!<br> <br> <br> </div> Maybe the line breaks between <br> are causing regex_replace to miss it? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 8, 2013 Share Posted November 8, 2013 actually, as I was coding the solution and saw the break returns in the source code, I thought "he's going to want me to get rid of these too !" there is a way to get rid of them, but frankly I wouldn't bother - let me explain why... as a test, if you use the following code to replace {$reply.message} {$reply.message|replace:'----------------------------':''|regex_replace:"/<br(\s*)?\/?\>/":""|regex_replace:'/IP Address: (\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))$/':''} this will remove all break returns from the message - on a live setup, you shouldn't use the above for the obvious reason that it would mess up the format of the ticket text layout... but do so and all the <br/> will be removed. however, the space is still there even when they're removed - so what is creating the space is the css for the <div> - so to reduce that space, you need to edit whmcs.css and alter the following... .whmcscontainer .ticketmsgs .clientmsg { margin: 0 10px; padding: 10px 15px; min-height: 100px; background: #f4f4f4; border: 1px solid #ccc; border-top: 0; border-bottom: 0; } change the line in red to a smaller number - 25px is probably fine for a one-line ticket, but have a play with it in your own template to figure out the most appropriate size. as an aside, you could in theory alter the regex to replace "\n" which is what is generating the break returns, but for the life of me, I couldn't get it to work - then when I found their presence only having a small influence on the output, I gave up trying to fix it! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.