What's new
Browse by Categories
All ·
/* To create a template placeholder map.
* 1. Create a top level object template.
* 2. This top level object contains an array with one entry for each placeholder in the template
* 3. Each entry for a placeholder has two members:
* - tmplKey: Identifies the regular expression used in the template
* - tmplMap: Identifies the member object in the JSON object which should replace the template placeholder.
*/
function getTmplPlaceHolderMap()
{
var placeHolderMap = new Array();
placeHolderMap[0] = new Object();
placeHolderMap[0].key = "http://resource2.smsgupshup.com/webimages/$CAT_PAGE_URL$.html";
placeHolderMap[0].dataMember = "catHREF";
placeHolderMap[1] = new Object();
placeHolderMap[1].key = "$CAT_NAME$";
placeHolderMap[1].dataMember = "catName";
return placeHolderMap;
}
function extractCatDataObjects(categoryList, start, limit)
{
var catArr = new Array();
var j = 0;
for(var i=start; i <= limit; i++)
{
var entry = new Object();
entry.catHREF = '/categories' + '/' + categoryList[i].name;
entry.catName = categoryList[i].displayName;
catArr[j++] = entry;
}
return catArr;
}
function catListJsp_process()
{
var featuredCatListJson = '/*-secure-{"params":{"limit":-1,"start":0,"type":"ALL_CATEGORIES","getAll":"false","needTotalForPg":false},"message":"","categories":[{"featuredRank":1,"status":"ENABLED","name":"Business","id":3,"displayName":"Business"},{"featuredRank":0,"status":"ENABLED","name":"Clubs &#38; Organizations","id":24,"displayName":"Clubs &#38; Organizations"},{"featuredRank":1,"status":"ENABLED","name":"Education &#38; Campus","id":4,"displayName":"Education &#38; Campus"},{"featuredRank":1,"status":"ENABLED","name":"Entertainment","id":5,"displayName":"Entertainment"},{"featuredRank":0,"status":"ENABLED","name":"Events &#38; Parties","id":19,"displayName":"Events &#38; Parties"},{"featuredRank":1,"status":"ENABLED","name":"Finance","id":6,"displayName":"Finance"},{"featuredRank":0,"status":"ENABLED","name":"Food &#38; Drinks","id":23,"displayName":"Food &#38; Drinks"},{"featuredRank":1,"status":"ENABLED","name":"Health","id":8,"displayName":"Health"},{"featuredRank":1,"status":"ENABLED","name":"Jobs","id":10,"displayName":"Jobs"},{"featuredRank":1,"status":"ENABLED","name":"Jokes","id":11,"displayName":"Jokes"},{"featuredRank":0,"status":"ENABLED","name":"Movies &#38; TV","id":12,"displayName":"Movies &#38; TV"},{"featuredRank":0,"status":"ENABLED","name":"Music","id":13,"displayName":"Music"},{"featuredRank":0,"status":"ENABLED","name":"News &#38; Politics","id":14,"displayName":"News &#38; Politics"},{"featuredRank":0,"status":"ENABLED","name":"People &#38; Blogs","id":26,"displayName":"People &#38; Blogs"},{"featuredRank":0,"status":"ENABLED","name":"Romance","id":25,"displayName":"Romance"},{"featuredRank":0,"status":"ENABLED","name":"Shopping &#38; Deals","id":21,"displayName":"Shopping &#38; Deals"},{"featuredRank":0,"status":"ENABLED","name":"Spirituality","id":20,"displayName":"Spirituality"},{"featuredRank":0,"status":"ENABLED","name":"Sports","id":17,"displayName":"Sports"},{"featuredRank":0,"status":"ENABLED","name":"Technology","id":16,"displayName":"Technology"},{"featuredRank":0,"status":"ENABLED","name":"Travel &#38; Lifestyle","id":22,"displayName":"Travel &#38; Lifestyle"}],"status":"SUCCESS","errorCode":"NO_ERROR"}*/';
if (GupShup.util.isInitialized(GupShup.conf.currentModule))
{
if (GupShup.util.trim(GupShup.conf.currentModule.refreshUrl) == '')
{
GupShup.conf.currentModule.refreshUrl
= GupShup.conf.readUrl + "&type=" + 'ALL_CATEGORIES'
+ '&getAll=false&needTotalForPg=false';
}
else
{
featuredCatListJson = GupShup.conf.currentModule.refreshArgs;
}
}
var featuredCatList = GupShup.util.getJsonFromResponse(featuredCatListJson);
if((typeof(featuredCatList.status) != 'undefined') && (featuredCatList.status == 'SUCCESS') && (featuredCatList.categories.length > 0))
{
var categoryList = featuredCatList.categories;
var tmplPlaceHolderMap = getTmplPlaceHolderMap();
var limit = ((categoryList.length < 200)? categoryList.length : 200);
/* Expand all the data objects, except the last, in the first template. */
var tmplDataObjArr = extractCatDataObjects(categoryList, 0, (limit - 2));
GupShup.util.expandTemplateInDiv("catEntrySpanRIGHT", "catEntryTemplateRIGHT", tmplPlaceHolderMap, tmplDataObjArr);
/* Expand the last entry in the second template. */
tmplDataObjArr = extractCatDataObjects(categoryList, (limit - 1), (limit - 1));
GupShup.util.expandTemplateInDiv("catLastEntrySpanIdRIGHT", "catLastEntryTemplateRIGHT", tmplPlaceHolderMap, tmplDataObjArr);
}
}
try
{
catListJsp_process();
}
catch(error)
{
if (GupShup.conf.jsDebug)
alert('Could not process catListJsp module : error-' + error);
}
$POSTS_COUNT$ posts, $SUBSCRIBER_COUNT$ members
Popular Groups
function popularGroupsJsp_process()
{
var jsonStr = '{"params":{"limit":5,"start":0,"type":"GLOBAL_POPULAR","showLatestMsg":"false","fromDays":15,"orientation":"RIGHT","newPage":"LOGIN","showAll":"false","sessionExpired":"true","showLatestMessage":false,"catId":"-1","newPageParams":"","needTotalForPg":false},"message":"","status":"SUCCESS","entities":[{"isDefault":"false","totalSubscribers":1064,"totalPosts":22,"imageUrl":"http://resource.smsgupshup.com/webimages/entity/6/164/6164811_1214346565535.png","userId":6164894,"isPrivate":false,"description":"Live tudate fo RAW&#44;SMACKDOWN&#44;ECW result &#38; wwe photo&#44;games links and more&#46;&#46;&#46; ","groupUrl":"http://www.smsgupshup.com/groups/WWERESULT","name":"WWERESULT","isPartner":false,"id":6164811,"orgName":"WWERESULT"},{"isDefault":"false","totalSubscribers":1420,"totalPosts":36,"imageUrl":"http://resource.smsgupshup.com/webimages/entity/6/94/6094886_1214346489647.png","userId":6094981,"isPrivate":false,"description":"Latest website&#44;free sms tricks&#44;mobile secreat code and many more&#46; Co 09893999236 join my another group sonu&#95;rocks ","groupUrl":"http://www.smsgupshup.com/groups/Internet_tips","name":"Internet&#95;tips","isPartner":false,"id":6094886,"orgName":"Internet_tips"},{"isDefault":"false","totalSubscribers":386,"totalPosts":39,"imageUrl":"http://resource2.smsgupshup.com/webimages/entity/6/97/6097967_1215082680771.png","userId":6098049,"isPrivate":false,"description":"tis is the only stocks group on gupshup ","groupUrl":"http://www.smsgupshup.com/groups/MTMSTOCKS","name":"MTMSTOCKS","isPartner":false,"id":6097967,"orgName":"MTMSTOCKS"},{"isDefault":"false","totalSubscribers":1335,"totalPosts":104,"imageUrl":"http://resource2.smsgupshup.com/webimages/entity/6/876/6876656_1214561666345.png","userId":6876702,"isPrivate":false,"description":"jamsheermckr4u&#64;gmail&#46;com ","groupUrl":"http://www.smsgupshup.com/groups/NEWSLIVE","name":"NEWSLIVE","isPartner":false,"id":6876656,"orgName":"NEWSLIVE"},{"isDefault":"false","totalSubscribers":762,"totalPosts":23,"imageUrl":"http://resource2.smsgupshup.com/webimages/entity/6/721/6721329_1214347134018.png","userId":6721377,"isPrivate":false,"description":"kya aap naye dost banana chahte hai&#63; plz join it&#46; &#38; detiles send it 9723771633&#46; ","groupUrl":"http://www.smsgupshup.com/groups/FRIENDS_CAFE","name":"FRIENDS&#95;CAFE","isPartner":false,"id":6721329,"orgName":"FRIENDS_CAFE"}],"errorCode":"NO_ERROR","urchinUrl":"/popular?start=0"}';
if (GupShup.util.isInitialized(GupShup.conf.currentModule))
{
if (GupShup.util.trim(GupShup.conf.currentModule.refreshUrl) == '')
{
GupShup.conf.currentModule.refreshUrl
= GupShup.conf.readUrl + "&type=" + 'GLOBAL_POPULAR'
+ '&showLatestMsg=false' + '&showAll=false' + '&fromDays=' + '15'
+ '&start=0' + '&limit=' + '5' + '&needTotalForPg=false';
}
else
{
featuredCatListJson = GupShup.conf.currentModule.refreshArgs;
}
}
var popularGroups = GupShup.util.getJsonFromResponse(jsonStr);
if((typeof(popularGroups.status) != 'undefined') && (popularGroups.status == 'SUCCESS') && (popularGroups.entities.length > 0))
{
var map =
[
{key:'http://resource.smsgupshup.com/webimages/$GROUP_IMG_SRC$.jpg', dataMember:'imageUrl'},
{key:'$GROUP_NAME$', dataMember:'name'},
{key:'http://resource.smsgupshup.com/webimages/$GROUP_PAGE_URL$.jpg', dataMember:'groupUrl'},
{key:'$POSTS_COUNT$', dataMember:'totalPosts'},
{key:'$SUBSCRIBER_COUNT$', dataMember:'totalSubscribers'}
];
GupShup.util.expandTemplateInDiv('popularGroupsContainerRIGHT', 'popularGroupsTemplateRIGHT', map, popularGroups.entities);
}
}
try
{
popularGroupsJsp_process();
}
catch(error)
{
if (GupShup.conf.jsDebug)
alert('Could not process popularGroups module : error-' + error);
}
var innerScriptDiv = "";
var innerScriptText = "";
var orientation = "RIGHT";
var modules = GupShup.conf[orientation + '_Modules'] = new Array();
GupShup.conf.currentModule = modules[0] = {name : 'whatsNew.jsp', rank : 0,
orientation : 'right', refreshUrl : '', refreshArgs : ''};
GupShup.html.dynamicBar.executeJavaScript('whatsNew.jsp_RIGHT_javaScript');
GupShup.conf.currentModule = modules[1] = {name : 'popularCat.jsp', rank : 1,
orientation : 'right', refreshUrl : '', refreshArgs : ''};
GupShup.html.dynamicBar.executeJavaScript('popularCat.jsp_RIGHT_javaScript');
GupShup.conf.currentModule = modules[2] = {name : 'popularGroups.jsp', rank : 2,
orientation : 'right', refreshUrl : '', refreshArgs : ''};
GupShup.html.dynamicBar.executeJavaScript('popularGroups.jsp_RIGHT_javaScript');
GupShup.conf.currentModule = null;
|


