Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 14 of 14
  1. #1
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to view/edit a php "instance"

    Good Morning,

    I'm currently managing a website which a company has developed years ago (and is now out of business, so naturally I'm unable to contact anyone there. And I'm only an Intern so, yeah.).

    I'm faily decent with HTML coding but I've never so much as touched PHP.
    What I need to do is edit and view the source of a couple of PHP tags, i.e.:

    {:newsList:}

    I have full access to the FTP and the Administrator page, but I can't seem to find the particular coding which I have to edit in order to add news and whatnot.

    Any help? If you need more details or if I'm being incomprehensible, I'll try to provide them and be a little clearer if wanted.

    Best Regards

  • #2
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay, follow-up, since I didn't really make myself clear:

    I know where the items are located for this specific {:newsList:} (they're on the /admin page.), but on the website itself only the 3 most recent news are shown in the news/events-box, where the php tag {:newsList:} is located. so in order to add more than 3 news, I figure I have to edit SOMETHING _SOMEWHERE_, but I have no idea where to look. there's nothing in the templates and I have no idea whatsoever if and where I can edit the php tags (I know I'm probably using the incorrect terminology, forgive me.).

    Best Regards

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Its likely a mysql query that is returning only 3 rows from a database. Can you post the code for your admin page? Also this doesn't belong in the HTML/CSS forum.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #4
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry about the wrong forum, I kind of stumbled in here via google.

    Anyway, which code do you mean specifically? From the selected news?

    The three news are in the database along with all the other news that are in the /news column. Okay, let me rephrase this somehow: The /index.php?page=news has all the different news which are in the database, those I can edit (content/topic) and add new ones myself via simple "Add/Edit". Then on the main page there's a nifty little column on the right hand side of the page which shows current News and Events, and beneath that there's 3 news listed - the newest three - with date/topic/little snippet from the content and a "more" button. Those three news on the main page I want to edit and add MORE than 3. Yet I have no clue as to how I can edit that {:newsList:}.

  • #5
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    I know what you are trying to do but without you posting any code we can't help you much. Look for LIMIT 3 in your files. It will help narrow it down as to what you need to edit.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #6
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    At the risk of sounding overly ignorant: Where should I be looking exactly? I'm fairly certain there's no LIMIT 3 line anywhere in the templates, with which I've been working with for most of the time. /public_html/phpmyadmin? I've skimmed through a couple of php files like main, index, etc but nothing so far.

  • #7
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Quote Originally Posted by sydd View Post
    At the risk of sounding overly ignorant: Where should I be looking exactly? I'm fairly certain there's no LIMIT 3 line anywhere in the templates, with which I've been working with for most of the time. /public_html/phpmyadmin? I've skimmed through a couple of php files like main, index, etc but nothing so far.
    You'll need to do a mass find through all of your files. The only way your news. Again we NEED to see some code. Help us help you. Post the php to your index file. LIMIT 3 won't be in a template. It will be in a mysql query somewhere. If you do a search for mysql you'll likely find all of the queries on the site which is likely a lot but you'll probably find the one I'm talking about.

    You may want to consider hiring someone to do the work for you before you mess things up.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #8
    Regular Coder Samhain13's Avatar
    Join Date
    Aug 2008
    Location
    Pilipinas
    Posts
    169
    Thanks
    4
    Thanked 18 Times in 18 Posts
    This is a tough one, as Aerospace says, without any code solving this problem involves a lot of guess work. Anyway...

    The "LIMIT 3" probably won't be a line on its own. It will be a part of an SQL string/command, something like:

    Code:
     $sql = "SELECT * FROM `thedatabase` ORDER BY `id` LIMIT 3;" ;
    This code might appear in one of the files that you mentioned: main.php, index.php, etc. (Perhaps, if there is a file called "news.php", it probably is the best place to start looking for that SQL string/command.) But I don't think you should edit any of the files in phpmyadmin (unless you really know what you're doing).

    PHPMyAdmin is the set of scripts that give you the administrative interface to your MYSQL databases. In most cases, it will have nothing to do with your website's frontend presentation. So, I would suggest you leave the scripts in that directory untouched.
    Last edited by Samhain13; 04-30-2009 at 07:45 AM.
    I am a Man of Truth. I am a Free Human Person. I am a Peacemaker.
    ** Independent Multimedia Artist in Pasig **

  • #9
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The above thought is smart and doesn’t require any further addition. It’s perfect thought from my side.
    ..............
    nova
    Auto Quotes

  • #10
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you VERY much for the replies, I can't say I've made any progress, but at least now I know what I'm looking for.
    I figured out where the {::} strings eventually lead in PHPMyAdmin, but like I said I need that source code (the LIMIT 3 part). Because once I figure out where the guys that designed the website for the company put that, I'll be able to change a couple of other things as well that need doing.

    First thing I'm going to do now is sift through all the .php files on the server and try to look for that snippet of code (Maybe google knows where to get a this-program-can-search-all-your-documents-on-your-webserver-for-a-specific-code.exe). If I find it, I'll post whatever you guys need in order to help me.

    Of course there's no news.php in that folder, would be too easy now, wouldn't it? No wonder the design-company that did our website went out of business.

    Best Regards

  • #11
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Fun!

    I'm looking through all the .php files on the server, and now I downloaded one called locu.php which was in a file-archive somewhere, and WHAM:

    Detected
    Trojan program:
    Backdoor.PHP.C99Shell.m

    Is this normal? I know I'm not in the proper forum for this, but I figured you guys will probably know. Google doesn't give me anything about this specific trojan.

  • #12
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Forget the above.

    After hours of looking, I found alot of files in the /public_html/_engine folder with the term "newsList" in them.

    As follows:

    Files with the specific code: AGFunctionsLib.class.php, AGFunctionsLibEstore.class.php, 1AGFunctionsLib.class.php, 2AGFunctionsLib.class.php, etc... Problem is that most of these files are about 300kb large, meaning a ****load of code.

    The code itself is this:

    Code:
    /*--content--*/
    
    		$layout->AddComponent('topNavigation',$f->getTopNavigation());
    
    		$conf['fg2'] = "98;98;98";
    		$conf['bg2'] = "214;214;214";
    		$strTitleNews = "<img src='_engine/title.gif.php?args=".base64_encode($f->getInterfaceContent('TitlePractical').",150,26,LEFT,TREBUC.TTF,14,$strDisp,".$conf['fg2'].",".$conf['bg2'])."' vspace=0 hspace=0>";
    
    		$conf['fg3'] = "74;75;76";
    		$conf['bg3'] = "255;255;255";
    		$strTitleEvents = "<img src='_engine/title.gif.php?args=".base64_encode($f->getInterfaceContent('TitleEvents').",200,20,LEFT,TREBUC.TTF,11,$strDisp,".$conf['fg3'].",".$conf['bg3'])."' vspace=0 hspace=0>";
    
    
    		$layout->AddComponent('txtEventsList', 	$strTitleEvents);
    		$layout->AddComponent('txtNewsList', 	$strTitleNews);
    		$layout->AddComponent('newsList',			$f->getNewsList(3));
    		//$layout->AddComponent('eventsList',			$f->getEventList(3));
    Problem is that there's ALOT of newsList(3) stuff around. It gets repeated over and over again.

    Like so:

    Code:
    $conf['fg2'] = "74;75;76";
    		$conf['bg2'] = "255;255;255";
    		$strTitleNews = "<img src='_engine/title.gif.php?args=".base64_encode($f->getInterfaceContent('TitleNews').",200,20,LEFT,TREBUC.TTF,11,$strDisp,".$conf['fg2'].",".$conf['bg2'])."' vspace=0 hspace=0>";
    
    		$conf['fg3'] = "74;75;76";
    		$conf['bg3'] = "255;255;255";
    		$strTitleEvents = "<img src='_engine/title.gif.php?args=".base64_encode($f->getInterfaceContent('TitleEvents').",200,20,LEFT,TREBUC.TTF,11,$strDisp,".$conf['fg3'].",".$conf['bg3'])."' vspace=0 hspace=0>";
    
    
    		$layout->AddComponent('txtEventsList', 	$strTitleEvents);
    		$layout->AddComponent('txtNewsList', 	$strTitleNews);
    		$layout->AddComponent('newsList',			$f->getNewsList(3));
    		//$layout->AddComponent('eventsList',			$f->getEventList(3));
    Any of this useful in some way? Sorry for bothering you with this, by the way.

  • #13
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Its likely these lines.
    Code:
    $layout->AddComponent('newsList',			$f->getNewsList(3));
    If you can post the function for getNewsList we can tell you for sure but try changing that 3 to something else bigger or smaller.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #14
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Did it.

    Figured that the AGFunctionsLib was the original file and just sifted through until I found a part which started with Home Page and defaultPage, so I thought it had to be the one I was looking for.

    Changed the 3 to a 4 and voilà.

    Thanks again for the help.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •