vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Major Additions - Mary's Classifieds (https://vborg.vbsupport.ru/showthread.php?t=267194)

Christos Teriakis 08-21-2011 10:08 AM

Quote:

Originally Posted by nikosb (Post 2236094)
nothing has changed

Please connect with phpMyAdmin to your database. In the main page, right side you'll see a block "MySQL". Somewhere there is saying the database character set. What it's says there?

nikosb 08-21-2011 10:18 AM

Quote:

Originally Posted by ChrisTERiS (Post 2236099)
Please connect with phpMyAdmin to your database. In the main page, right side you'll see a block "MySQL". Somewhere there is saying the database character set. What it's says there?

MySQL: UTF-8 Unicode (utf8)

Christos Teriakis 08-21-2011 10:26 AM

Quote:

Originally Posted by nikosb (Post 2236101)
MySQL: UTF-8 Unicode (utf8)

What confuses me is that categories appear in Greek. Do you have locations as input or as droplist? If its input, then I need to check for inputs only.

nikosb 08-21-2011 10:45 AM

i have locations as input
I did check on all ads. is ok.
The problem remains

voglermc 08-21-2011 10:49 AM

I'm getting this error on the main page

Warning: Division by zero in [path]/microclassifieds/includes/functions.php on line 586

ndahiya 08-21-2011 11:58 AM

Quote:

Originally Posted by ChrisTERiS (Post 2236059)
I've replied it already. As I said, 80% of the new feature were custom work. As my clients have extra fields only related to seller (eg phone nbr etc), they wanted the extra fields there. I'll fix it, but I'll appreciate a lot to keep any design related problems after having a stable code version.

Chris

thx. must have missed it.

Jman423 08-21-2011 01:11 PM

Any idea why the vote iframe shows "page not found", or why I can't post premium ads?

maineGuy72 08-21-2011 02:05 PM

for random items with no photo i came up with this fix. its not the cleanest code but it works
it will display nophotosmall.jpg image for an ad with no photo assigned to it


find
Code:


$html_random .= '<tr valign="top"><td width="90" align="left">
<a href="classifieds.php?do=viewitem&itemid='.$random["id"].'">
<img src="'.$thumb.'" border="0" /></a></td>
<td align="left"><h4><a href="classifieds.php?do=viewitem&itemid='.$random["id"].'">'.$title.'</a>
</h4>'.$price.' '.$vbulletin->options["microclassifieds_currency"].'</td></tr>';

and replace with
Code:

$ad_photo = $random["logo"];
                  if(empty($ad_photo))
                  {
                  $html_random .= '<tr valign="top"><td width="90" align="left">
                    <a href="classifieds.php?do=viewitem&itemid='.$random["id"].'">
                  <img border="0" src="microclassifieds/images/nophotosmall.png" width="50" align="left" style="padding:3px;">                                               
                  <td align="left"><h4><a href="classifieds.php?do=viewitem&itemid='.$random["id"].'">'.$title.'</a>
                  </h4>'.$price.' '.$vbulletin->options["microclassifieds_currency"].'</td></tr>';
                  } else {
                  $html_random .= '<tr valign="top"><td width="90" align="left">
                  <a href="classifieds.php?do=viewitem&itemid='.$random["id"].'">
                <img src="'.$thumb.'" border="0" /></a></td>                                                       
                <td align="left"><h4><a href="classifieds.php?do=viewitem&itemid='.$random["id"].'">'.$title.'</a>
                </h4>'.$price.' '.$vbulletin->options["microclassifieds_currency"].'</td></tr>';
                }


Christos Teriakis 08-21-2011 04:31 PM

Quote:

Originally Posted by maineGuy72 (Post 2236160)
for random items with no photo.....

Try to replace the whole function getRandom($catid) in functions.php with this code:
Code:

// Get Random Items
function getRandom($catid)
{
    global $db, $vbulletin, $vbphrase, $random_items, $random_items_bit, $catid;
 
    if (empty($catid))
    {
        $catid = 0;
    }
    $maximum_random = $vbulletin->options["microclassifieds_random_items"];
    $SubIds = array();
    $getSub = _getChildId($SubIds, $catid);
    $browsecategories = implode($SubIds, ', ');
    $sql_random = $db->query_read("SELECT * FROM ".TABLE_PREFIX."microclassifieds_items WHERE categoryid IN ($browsecategories) AND logo<>'' AND active=1 AND sold=0 AND hidden=0 ORDER BY rand() LIMIT $maximum_random");
    $total_random = $db->num_rows($sql_random);
    if($total_random == 0)
    {
          $sql_random = $db->query_read("SELECT * FROM ".TABLE_PREFIX."microclassifieds_items WHERE logo<>'' AND active=1 AND sold=0 AND hidden=0 ORDER BY rand() LIMIT $maximum_random");
    }
    $i = 0;
    $html_random = '';
    $thumb_path = 'microclassifieds/photos/thumbs/';
    while($random = $db->fetch_array($sql_random)) {
          if($i%2!='0')
          {
            $html_random .= '<tr><td height="35">&nbsp;</td></tr>';
          }
          if($i >= 2)
          {
            $html_random .= '</table></li><li><table cellpadding="3" cellspacing="0" border="0" width="100%">';
            $i = 0;
          }
          $i++;
          $title = getTitle($random['title']);
          $thumb = $thumb_path.$random['logo'];
          $price = getFormatPrice($random['price']);
          $html_random .= '<tr valign="top"><td width="90" align="left">
                          <a href="classifieds.php?do=viewitem&itemid='.$random["id"].'">
                          <img src="'.$thumb.'" border="0" /></a></td>
                          <td align="left"><h4><a href="classifieds.php?do=viewitem&itemid='.$random["id"].'">'.$title.'</a>
                          </h4>'.$price.' '.$vbulletin->options["microclassifieds_currency"].'</td></tr>';
    }
    $templater = vB_Template::create('microclassifieds_random_items');
    $templater->register('html_random', $html_random);
    $random_items .= $templater->render();
    return;
}

This code:
  1. Shows only Ads with photos
  2. Shows Ads from subcategories too

Christos Teriakis 08-21-2011 04:34 PM

Quote:

Originally Posted by voglermc (Post 2236109)
I'm getting this error on the main page

Warning: Division by zero in [path]/microclassifieds/includes/functions.php on line 586

Goto General Settings (admincp) and set Store block greater than 0.


All times are GMT. The time now is 12:22 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02237 seconds
  • Memory Usage 1,756KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (4)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete