Webmastersite.net
Register Log In

New Suggest Category feature

Comments on New Suggest Category feature

Jenny
Forum Regular

Usergroup: Customer
Joined: May 11, 2003

Total Topics: 64
Total Comments: 199
Jenny
Posted Oct 08, 2006 - 9:24 AM:

I like the possibility to suggest a new category when submitting a link. Is it possible to copy and paste the code into the "Edit Link" page as well?

And what happens if someone suggests a category through that field? Will the link automatically associated with it? And the category is added to the list of categories to validate?
What happens if I wanna accept the link, but not the category? Is the link then added to the parent category or the top level or something?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Oct 08, 2006 - 7:06 PM:

The edit link page won't handle it. I don't see much application there but I'll consider it.

Will the link automatically associated with it? And the category is added to the list of categories to validate?
What happens if I wanna accept the link, but not the category? Is the link then added to the parent category or the top level or something?


The link will initially be pending in whatever category is selected in the regular selector. If they've suggested a new category as well, then once the new category is validated the link (which has that category id hidden in its sugcatid field) will move itself to the new category.
Jenny
Forum Regular

Usergroup: Customer
Joined: May 11, 2003

Total Topics: 64
Total Comments: 199
Jenny
Posted Oct 09, 2006 - 3:21 AM:

The edit link page won't handle it. I don't see much application there but I'll consider it.

It's not really SUPER important. It just would have made my life a little bit easier. I'm not quite over the fact that I can't really use the category selector anymore, because it always times out. But moving links to a new category with only the IDs is so ... *ugh*
But I guess there's just no alternative.

I just had my first case of suggested category and it worked great *yay*
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Oct 10, 2006 - 12:47 PM:

Replacing your filltheselector function in functions.php with this one ought to save some iterations and perhaps make the category selector not time out:
function filltheselector($next)
{
global $db, $settings, $language, $mapids, $categorypref, $scriptname;
if ($scriptname == 'wsnforum')
{
$ctypes = explode(',', $settings->cattypes);
$ltypes = explode(',', $language->categorytypes);
$n = sizeof($ctypes);
for ($x=0; $x<$n; $x++)
{
$categoryselect .= '<optgroup label="'. $ltypes[$x] .'">';
$categoryselect .= fillcattype($ctypes[$x], 0);
$categoryselect .= '</optgroup>';
}
}
else
{
$order = $settings->ordercats;
if ($settings->ordercatselector != '') $order = $settings->ordercatselector;
if ($settings->ordercats2 != '') $order .= str_replace('ORDER BY ', ',', $settings->ordercats2);
$query = $db->select('id,name,parentids,parentnames,numsub', 'categoriestable', "parent=$next AND validated=1 AND hide=0 AND deleted=0 AND isalbum=0", $order, '');
$num = $db->numrows($query);
for ($count=0; $count<$num; $count++)
{
$row = $db->row($query);
$id = $row[0];
$name = $row[1];
$parentids = $row[2];
$parentnames = $row[3];
$numsub = $row[4];
$rewritepath = '';
if ($parentnames != '' && strstr($settings->optionscontent, 'REWRITEPATH}'))
{
$group = explode(', ', $parentnames);
$n = sizeof($group);
for ($x=$n; $x>0; $x--)
{
if ($group[$x] != '')
{
$rewritepath .= urlencode(str_replace(' ', $settings->rewritecategoryspace, $group[$x])) .'/';
}
}
}
$rewritepath .= urlencode(str_replace(' ', $settings->rewritecategoryspace, $name));
$parentarray = explode(', ', trim($parentids, ', '));
if ($parentarray[0] > 0) $level = sizeof($parentarray) + 1;
else $level = 1;
$indent = '';
if ($settings->selectorlevels >= $level)
{
for ($dum=1; $dum<$level; $dum++)
$indent .= $language->catselector_indent;
$thisoption = str_replace($categorypref .'ID}', $id, $settings->optionscontent);
$thisoption = str_replace($categorypref .'NAME}', $name, $thisoption);
$thisoption = str_replace($categorypref .'INDENT}', $indent, $thisoption);
$thisoption = str_replace($categorypref .'REWRITEPATH}', $rewritepath, $thisoption);
$categoryselect .= $thisoption;
$mapids .= ','. $id;
// now we work on the children...
if (($settings->selectorlevels > 1 || $settings->maplevels > 1) && $numsub) $categoryselect .= filltheselector($id);
}
else if ($settings->maplevels >= $level)
{
$mapids .= ','. $id;
if (($settings->maplevels > 1 || $settings->selectorlevels > 1) && $numsub) $mapids .= filltheselector($id);
}
}
}
return $categoryselect;
}


Let me know if it makes a difference or if it leaves out categories it ought to be listing.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.