Support Forums

Constant IN_ADMIN

This is a discussion on Constant IN_ADMIN within the Technical Support forums, part of the Technical Support Forums category; Hi, My question is a bit technical. What is for the constant IN_ADMIN? I work on the file listings.php with ...


Go Back   68 Classifieds Forums > Technical Support Forums > Technical Support

This topic is resolved.

If you have a similar issue that this thread does not address, open a new related support topic.

 
Thread Tools Display Modes
Old 10-01-2009, 12:53 PM   #1
Customer
 
hel68c's Avatar
 
Join Date: Jun 2008
Location: Canada, Quebec
Posts: 285
Rep Power: 20
hel68c is just really nice hel68c is just really nice
Default Constant IN_ADMIN

Hi,

My question is a bit technical.

What is for the constant IN_ADMIN?

I work on the file listings.php with the function editListing($data) and I have this:

PHP Code:
        if(!defined('IN_ADMIN')) /
        {
            
$sSQL=sprintf("UPDATE ".PREFIX."listings SET title=%s,shortDescription=%s,description=%s,price=%s,display=%s,url=%s WHERE id=%s AND owner=%s",
                      
GetSQLValueString(htmlspecialchars($data['title']),"text"),
                    
GetSQLValueString(htmlspecialchars($data['shortDescription']),"text"),
                    
GetSQLValueString(htmlspecialchars($data['description']),"text"),
                    
GetSQLValueString($data['price'], "double"),
                    
GetSQLValueString($data['display'], "text"),
                    
GetSQLValueString($data['url'], "text"),
                    
GetSQLValueString($data['id'], "int"),
                    
GetSQLValueString($data['owner'],"int"));
        }
        else
        {
            
$sSQL=sprintf("UPDATE ".PREFIX."listings SET owner=%s,title=%s,section=%s,shortDescription=%s,description=%s,featured=%s,featured7=%s,featured7date=%s,price=%s,display=%s,dateadded=%s,expiration=%s,url=%s,pBold=%s,pHighlighted=%s WHERE id=%s",
                      
GetSQLValueString($data['owner'],"int"),
                      
GetSQLValueString(htmlspecialchars($data['title']),"text"),
                      
GetSQLValueString($data['section'], "int"),
                    
GetSQLValueString(htmlspecialchars($data['shortDescription']),"text"),
                    
GetSQLValueString(htmlspecialchars($data['description']),"text"),
                    
GetSQLValueString($data['featured'], "text"),
                    
GetSQLValueString($data['featured7'], "text"),
                    
GetSQLValueString($data['featured7date'], "text"),                    
                    
GetSQLValueString($data['price'], "double"),
                    
GetSQLValueString($data['display'], "text"),
                    
GetSQLValueString($data['dateadded'], "text"),
                    
GetSQLValueString($data['expiration'], "text"),
                    
GetSQLValueString($data['url'], "text"),
                    
GetSQLValueString($data['bold'], "text"),
                    
GetSQLValueString($data['highlighted'], "text"),
                    
GetSQLValueString($data['id'], "int"));
        } 
The problem is that if I place a new ad with the option BOLD and later I change my mind and I come back (press on Details link) for HIGHLIGHTED instead of BOLD, the system does not change for the new option.


I noticed that if I changed the line if(!defined('IN_ADMIN')) for if(defined('IN_ADMIN')), it worked. I wonder if this change will have problems later in the system.
__________________
Serge
HobbyClassified.com
V4.08 Developper, Module installed (CIV Scam Filter, Maffo Location System, Maffo News,Youtube, Seller Store)
hel68c is offline  
Old 10-01-2009, 01:01 PM   #2
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,489
Rep Power: 133
Eric Barnes is just really nice Eric Barnes is just really nice
Default

The in_admin constant is used to tell the script weather you are in the administration or not. Then based off this it performs different queries.

I think the issue you have may be related to this bug:
http://www.68classifieds.com/forums/issue-369/
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline  
Old 10-02-2009, 12:46 AM   #3
Customer
 
hel68c's Avatar
 
Join Date: Jun 2008
Location: Canada, Quebec
Posts: 285
Rep Power: 20
hel68c is just really nice hel68c is just really nice
Default

Thanks for help.
__________________
Serge
HobbyClassified.com
V4.08 Developper, Module installed (CIV Scam Filter, Maffo Location System, Maffo News,Youtube, Seller Store)
hel68c is offline  
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Seo Mod Issue - Undefined Constant SEO_String Offshoreboat Technical Support 4 04-28-2009 02:21 PM


All times are GMT -4. The time now is 02:29 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0