#1 (permalink)  
Old 24.03.2010, 11:48
vbdesigns Guru
 
Join Date: 03.2006
Posts: 528
Rep Power: 8
WeserInfo has a spectacular aura aboutWeserInfo has a spectacular aura about
PP Classifieds Modul
Hallo,

Christian hatte uns ja freundlicherweise das Modul für die Photopost Pro Software zurechtgebogen

Von Photopost gibt es auch die Kleinanzeigen-Software "Photopost Classifieds". Nach diesem Bericht soll der Code für die Bilderbox des Photobereiches ähnlich dem Kleinanzeigenbereich sein. Was meinen die Fachleute ? Ist das ohne riesen Aufwand umsetzbar ?

Jetziger Code des Photopost Moduls von Christian :

Code:
<?php
require $vbulletin->options['pppath'].'/config-int.php';

$dbhost = $vbulletin->options['dbhost'];
$dbuser = $vbulletin->options['dbuser'];
$dbpass = $vbulletin->options['dbpass'];
$dbname = $vbulletin->options['db1'];
$link = mysql_connect ("$dbhost", "$dbuser", "$dbpass") or die('I cannot connect to the database.');
mysql_select_db ("$dbname")or die("Could not select photopost database");

// Number of photos to display
$num_display = 4;

// Number of columns (1 for vertical)
$columns = 4;

// which type of images do you want to show (random, most_view, latest)
$q_switch = "latest";


// == END CONFIGURATION ==
////////////////////////////////////////////////////////////////////////////

if ( !isset($ViewPerm) )
{
    if ( isset($bbuserinfo['usergroupid']) )
    {
        $mygroups = $bbuserinfo['usergroupid'];

        if ( $bbuserinfo['membergroupids'] != "" )
        {
            $mygroups .= ",".$bbuserinfo['membergroupids'];
        }
    }
    else
    {
        // vB3.5 uses $vbulletin
        $mygroups = $vbulletin->userinfo['usergroupid'];

        if ( $vbulletin->userinfo['membergroupids'] != "" )
        {
            $mygroups .= ",".$vbulletin->userinfo['membergroupids'];
        }
    }

    $grouparr = explode( ",", $mygroups );

    $resultb = mysql_query("SELECT id,ugnoview FROM {$pp_db_prefix}categories");
    $ViewPerm = array();

    while ( list( $catugid, $ugnoview ) = mysql_fetch_row($resultb) )
    {
        $noview=0;
        $ViewPerm[$catugid] = 1;

        $allnoview = explode( ",", $ugnoview );

        foreach ($allnoview as $key)
        {
            if (in_array($key, $grouparr) )
            {
                $noview = 1;
            }
        }

        if ( $noview == 0 )
        {
            $ViewPerm[$catugid]=0;
        }
    }
}

function pp_get_ext( $filename )
{
    return substr($filename, strrpos($filename,"."));
}

function pp_get_filename($filename)
{
    return str_replace( pp_get_ext($filename), "", $filename );
}

function pp_is_image( $filename )
{
    $mediatypes = array( ".jpg", ".gif", ".png", ".bmp" );
    $ext = pp_get_ext( $filename );

    if ( in_array(strtolower($ext), $mediatypes) )
    {
        return( true );
    }

    return( false );
}

function pp_is_multimedia( $filename )
{
    $mediatypes = array( ".avi", ".mov", ".mpg", ".mpeg", ".swf", ".flv" );
    $ext = pp_get_ext( $filename );

    if ( in_array(strtolower($ext), $mediatypes) )
    {
        return( true );
    }

    return( false );
}

$resultc = mysql_query("SELECT setting FROM {$pp_db_prefix}settings WHERE id=133");
list( $seotype ) = mysql_fetch_row($resultc);

$resultd = mysql_query("SELECT setting FROM {$pp_db_prefix}settings WHERE id=6");
list( $data_full ) = mysql_fetch_row($resultd);
//
// Featured Photos Code
// Follow down to End Feature Photos Code
//

switch ($q_switch)
{
    case "most_view":
        $query = "SELECT p.id,p.user,p.userid,p.cat,p.bigimage,p.title,c.catname,c.photos,c.posts
                        FROM {$pp_db_prefix}photos p
                        LEFT JOIN {$pp_db_prefix}categories c ON c.id = p.cat
                        WHERE c.password = '' AND p.storecat = 0
	                ORDER BY views DESC";
        break;

    case "latest":
        $query = "SELECT p.id,p.user,p.userid,p.cat,p.bigimage,p.title,c.catname,c.photos,c.posts
                        FROM {$pp_db_prefix}photos p
                        LEFT JOIN {$pp_db_prefix}categories c ON c.id = p.cat
                        WHERE c.password = '' AND p.storecat = 0
                        ORDER BY date DESC";
        break;

    default:
        $query = "SELECT p.id,p.user,p.userid,p.cat,p.bigimage,p.title,c.catname,c.photos,c.posts
                        FROM {$pp_db_prefix}photos p
                        LEFT JOIN {$pp_db_prefix}categories c ON c.id = p.cat
                        WHERE c.password = '' AND p.storecat = 0
                        ORDER BY RAND()";
}
$result = mysql_query($query) or die(mysql_error());

$counted = 0;
$countcol = 0;
$pppro_imagebits = null;
$pppro_imagebits .= '<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr>';
while (list($pid,$puser,$puserid,$pcat,$photo,$ptitle,$catname,$cphotos,$cposts) = mysql_fetch_row($result))
{

    if ( pp_is_image($photo)|| pp_is_multimedia($photo) )
    {
	    if ( pp_is_image($photo) )
	    {
	        if ( $seotype == "seo" )
	        {
	            $plink = "<td><a href=\"{$url_path}/$catname/p{$pid}-{$ptitle}.html\"><img src=\"{$data_dir}{$pcat}/thumbs/$photo\" border=\"0\" alt=\"\" /></a><br />";
	            $catlink = "<a href=\"{$url_path}/g{$pcat}-{$catname}.html\">$catname</a><br />";
	        }
	        else
	        {
	            $plink = "<td><a href=\"{$url_path}/showphoto.php?photo={$pid}\"><img src=\"{$data_dir}{$pcat}/thumbs/$photo\" border=\"0\" alt=\"\" /></a><br />";
	            $catlink = "<a href=\"{$url_path}/showgallery.php?cat={$pcat}\">$catname</a><br />";
	        }
	    }

	    if ( pp_is_multimedia($photo) )
	    {
	        $filenoext = pp_get_filename( $photo );
	        $mmthumb = "{$data_dir}/$pcat/thumbs/$filenoext.jpg";
	        $dirthumb = "{$data_full}/$pcat/thumbs/$filenoext.jpg";

	        if ( !file_exists($dirthumb) )
	        {
	            $mmthumb = "{$url_path}/images/video.gif";
	        }

	        if ( $seotype == "seo" )
	        {
	            $plink = "<td><a href=\"{$url_path}/$catname/p{$pid}-{$ptitle}.html\"><img src=\"{$mmthumb}\" border=\"0\" alt=\"\" /></a><br />";
	            $catlink = "<a href=\"{$url_path}/g{$pcat}-{$catname}.html\">$catname</a><br />";
	        }
	        else
	        {
	            $plink = "<td><br /><a href=\"{$url_path}/showphoto.php?photo={$pid}\"><img src=\"{$mmthumb}\" border=\"0\" alt=\"\" /></a><br />";
	            $catlink = "<a href=\"{$url_path}/showgallery.php?cat={$pcat}\">$catname</a><br />";
	        }
	    }

// One box for each feature
$pppro_imagebits .= <<<PPPRINT

         $plink

        <font size="1" face="verdana,arial">by {$puser}<br />
        · · ·<br />
        $catlink
        $cphotos photos<br />$cposts comments<br /></font>
</td>
PPPRINT;

        $counted++;
        $countcol++;
    }

    // If we've reached our limit, quit
    if ( $counted == $num_display )
    {
        break;
    }

    // If we need to end the column, do so.
    if ( $countcol == $columns )
    {
$pppro_imagebits .= <<<PPPRINT
    </tr>
    <tr>
PPPRINT;

    $countcol = 0;
    }
}
@mysql_free_result($result);

$pppro_imagebits .= '</tr></table';
$templater = vB_Template::create('forumhome_addon');
$templater->register_page_templates();
$templater->register('pppro_imagebits', $pppro_imagebits);

$template_hook['forumhome_above_forums'] .= $templater->render();
echo '<div class="vbcmsmodul collapse">
      <h2 class="blockhead vbcmsmodul_head">
         Neue Galerie-Bilder
      </h2>
      <div class="blockrow vbcmsmodul_body">';

echo $pppro_imagebits;

echo '      </div>
</div>';
?>
Der im Photopost Classified abgebildete Code für die Kleinanzeigen :

Code:
$host = 'localhost';
$dbUser = ' ';
$dbPass = '';
$db = '';
mysql_connect("$host", "$dbUser", "$dbPass") or die(mysql_error());
mysql_select_db("$db") or die(mysql_error());

ob_start();

$result = mysql_query("SELECT id,cat,bigimage FROM cp_products order by rand() LIMIT 1" ) or die(mysql_error());
while($row = mysql_fetch_array( $result )) {
print"<center>";
print "<a href=\"http://mysite.net/pp-classifieds/showproduct.php?product=" . $row['id'] . "&cat=" . $row['cat'] . "\"><img src=\"http:/mysite.net/pp-classifieds/data/" . $row['cat'] . "/thumbs/" . $row['bigimage'] . "\" border=\"0\"></a>";
print "</center>";
}

$output .= ob_get_contents();
ob_end_clean();
Reply With Quote
  #2 (permalink)  
Old 24.03.2010, 11:53
Christian's Avatar
Web Design
 
Join Date: 12.2003
Location: In Spocks Quartier
Age: 34
Posts: 16,869
Rep Power: 10
Christian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond repute
Jap ist ne Kleinigkeit.
__________________
Meine kleinen Engel ... Die Rabauken ...
Reply With Quote
  #3 (permalink)  
Old 24.03.2010, 11:57
vbdesigns Guru
 
Join Date: 03.2006
Posts: 528
Rep Power: 8
WeserInfo has a spectacular aura aboutWeserInfo has a spectacular aura about
Quote:
Originally Posted by Christian View Post
Jap ist ne Kleinigkeit.

Hörst Du das Schleifen ? Ich meine das Schleifen meiner Knie vor Dir
Reply With Quote
  #4 (permalink)  
Old 24.03.2010, 12:48
Christian's Avatar
Web Design
 
Join Date: 12.2003
Location: In Spocks Quartier
Age: 34
Posts: 16,869
Rep Power: 10
Christian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond repute
Code:
$host = 'localhost';
$dbUser = ' ';
$dbPass = '';
$db = '';
mysql_connect("$host", "$dbUser", "$dbPass") or die(mysql_error());
mysql_select_db("$db") or die(mysql_error());


$result = mysql_query("SELECT id,cat,bigimage FROM cp_products order by rand() LIMIT 1" ) or die(mysql_error());
while($row = mysql_fetch_array( $result )) {
print"<center>";
print "<a href=\"http://mysite.net/pp-classifieds/showproduct.php?product=" . $row['id'] . "&cat=" . $row['cat'] . "\"><img src=\"http:/mysite.net/pp-classifieds/data/" . $row['cat'] . "/thumbs/" . $row['bigimage'] . "\" border=\"0\"></a>";
print "</center>";
}
und puffern ...
__________________
Meine kleinen Engel ... Die Rabauken ...
Reply With Quote
  #5 (permalink)  
Old 24.03.2010, 12:54
vbdesigns Guru
 
Join Date: 03.2006
Posts: 528
Rep Power: 8
WeserInfo has a spectacular aura aboutWeserInfo has a spectacular aura about
Quote:
Originally Posted by Christian View Post
Code:
$host = 'localhost';
$dbUser = ' ';
$dbPass = '';
$db = '';
mysql_connect("$host", "$dbUser", "$dbPass") or die(mysql_error());
mysql_select_db("$db") or die(mysql_error());


$result = mysql_query("SELECT id,cat,bigimage FROM cp_products order by rand() LIMIT 1" ) or die(mysql_error());
while($row = mysql_fetch_array( $result )) {
print"<center>";
print "<a href=\"http://mysite.net/pp-classifieds/showproduct.php?product=" . $row['id'] . "&cat=" . $row['cat'] . "\"><img src=\"http:/mysite.net/pp-classifieds/data/" . $row['cat'] . "/thumbs/" . $row['bigimage'] . "\" border=\"0\"></a>";
print "</center>";
}
und puffern ...

Öhm ? Hatten wir das spielchen nicht schon mal ? Das gibt nur ne weiße Seite. Da fehlt doch noch etliches ?

Wenn ich mit deinem Code ne PHP erstelle kommt als Ergebnis, weiße Seite. Leider kann ich erst Heute Abend wieder gucken.
Reply With Quote
  #6 (permalink)  
Old 24.03.2010, 13:05
Christian's Avatar
Web Design
 
Join Date: 12.2003
Location: In Spocks Quartier
Age: 34
Posts: 16,869
Rep Power: 10
Christian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond repute
Ne das ist alles, bis auch <?php ?> das musst du oben und unten noch einfügen.
__________________
Meine kleinen Engel ... Die Rabauken ...
Reply With Quote
  #7 (permalink)  
Old 24.03.2010, 13:10
vbdesigns Guru
 
Join Date: 03.2006
Posts: 528
Rep Power: 8
WeserInfo has a spectacular aura aboutWeserInfo has a spectacular aura about
Quote:
Originally Posted by Christian View Post
Ne das ist alles, bis auch <?php ?> das musst du oben und unten noch einfügen.

Na das habe ich natürlich gemacht Trotzdem gehts nicht So,, muss los.. ich gucke und versuche Heute Abend nochmal. Danke trotzdem.
Reply With Quote
  #8 (permalink)  
Old 31.03.2010, 06:54
vbdesigns Guru
 
Join Date: 03.2006
Posts: 528
Rep Power: 8
WeserInfo has a spectacular aura aboutWeserInfo has a spectacular aura about
Moins,

also ich habe es noch einmal probiert. Leider klappt es nicht. Sobald das Modul aktiviert ( und gepuffert ) ist gibt es eine weiße Seite.

edit :

Hier erstmal stop. Ich muss ja auch das Plugin dafür einbauen und anpassen ( vom Photopost ) um das für Classifieds zu nutzen.

Last edited by WeserInfo : 31.03.2010 at 07:35.
Reply With Quote
  #9 (permalink)  
Old 08.04.2010, 15:20
Benutzer
 
Join Date: 06.2005
Posts: 61
Rep Power: 7
Mike_K is on a distinguished road
Ich muss sagen, ich check mal wieder gar nichts.

Dieses "Modul" wäre auch für mich interessant. Lief im VB4 CMS einwandfrei.

Ich versteh aber überhaupt nicht, wie ich da vorgehen muss. Im VB 4 CMS ist das recht einfach mit den Widgets. Hinzufügen, Code da rein und fertig.

Wenn ich die Modulverwaltung im VBCMS aufrufe steige ich überhaupt nicht durch. Muss ich immer eine fertige Datei importieren?

Was ist damit gemeint

Quote:
Wenn Sie ein PHP Modul erstellen können Sie mehrere Templates angeben, trennen Sie diese dann mit Kommata.

Wenn Sie ein Template Modul erstellen, geben Sie bitte das Template an was Sie benutzen möchen.

Was für Templates sollen angegeben werden? Woher soll ich wissen, was für Bezeichnungen es da gibt?

Gibt es irgendwo eine Anleitung für die Modulerstellung.., "Step by Step"?
Reply With Quote
  #10 (permalink)  
Old 08.04.2010, 15:42
Benutzer
 
Join Date: 06.2005
Posts: 61
Rep Power: 7
Mike_K is on a distinguished road
Die letzte Frage ziehe ich zurück.
Boahh... ist das kompliziert. Ich hatte mir eigentlich vorgestellt, dass das so einfach wie in der VB Suite ist und dass auch der Code von dafür exitstierenden Widgets einfach übernommen werden kann.
Reply With Quote
  #11 (permalink)  
Old 08.04.2010, 15:54
Christian's Avatar
Web Design
 
Join Date: 12.2003
Location: In Spocks Quartier
Age: 34
Posts: 16,869
Rep Power: 10
Christian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond repute
Quote:
Originally Posted by Mike_K View Post
Gibt es irgendwo eine Anleitung für die Modulerstellung.., "Step by Step"?

Ja hier, ist ganz Easy ==> Modul-Verwaltung - vBCMS
PS: Die Templates sind kein muss, wenn du keine brauchst gibst du auch keine an.
__________________
Meine kleinen Engel ... Die Rabauken ...
Reply With Quote
  #12 (permalink)  
Old 08.04.2010, 17:33
Benutzer
 
Join Date: 06.2005
Posts: 61
Rep Power: 7
Mike_K is on a distinguished road
Ich finde es eben nicht "easy".

So baue ich mir z.B. eine PHP Datei "vbcmsmodul_classifieds.php" mit dem von dir geposteten Code (#4), lege die Datei in das Verzeichnis vbcms_global_modules, kopiere in der Modulverwaltung ein PHP-Modul, bennene es um und wähle in diesem neuen Modul die erstellte PHP Datei.

Sollte dann ja eigentlich klappen, oder?

Einziger Erfolg nach Aktivierung:

"Fatal error: Call to a member function query_read() on a non-object in /usr/www/users/blauev/test/vbcms_global_modules/vbcmsmodul_linklist.php on line 42"

Wenn der Fehler nun in der "vbcmsmodul_classifieds.php" wäre, aber in der "vbcmsmodul_linklist.php".....


Egal... die Glückseligkeit hängt nicht von der Individualisierung ab. Ich finde es nur schade, dass man vorhandene Widget-Codes (VB Suite) nicht einfacher übernehmen/einbinden kann.

Dies einfach als Verbesserungsvorschlag für spätere Versionen.
Reply With Quote
  #13 (permalink)  
Old 08.04.2010, 18:17
Christian's Avatar
Web Design
 
Join Date: 12.2003
Location: In Spocks Quartier
Age: 34
Posts: 16,869
Rep Power: 10
Christian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond reputeChristian has a reputation beyond repute
Wo steht dass du ein Modul kopieren sollst? Du sollst ein neues anlegen und die "vbcmsmodul_classifieds.php" als Datei wählen ...
__________________
Meine kleinen Engel ... Die Rabauken ...
Reply With Quote
  #14 (permalink)  
Old 08.04.2010, 18:50
vbdesigns Guru
 
Join Date: 03.2006
Posts: 528
Rep Power: 8
WeserInfo has a spectacular aura aboutWeserInfo has a spectacular aura about
Mike ich denke wir werden da bald das Modul haben. Christian hatte uns auch bei dem Photopost Modul geholfen. Erstmal musste aber VBCMS Gold und die styles raus. Alles auf einmal geht schlecht. Wenn das hier fertig ist wird es im Modul Bereich wieder zum runterladen sein Wie auch das Photopost Modul.
Reply With Quote
  #15 (permalink)  
Old 08.04.2010, 19:03
Benutzer
 
Join Date: 06.2005
Posts: 61
Rep Power: 7
Mike_K is on a distinguished road
Quote:
Originally Posted by Christian View Post
Wo steht dass du ein Modul kopieren sollst? Du sollst ein neues anlegen und die "vbcmsmodul_classifieds.php" als Datei wählen ...

Das steht nirgendwo. Ist das so "schlimm"?

Modul deinstalliert, im Verzeichnis die PHP-Datei gelöscht.
Dann ohne kopiertes Modul die PHP-Datei hinzugefügt.

Gleicher Fehler (na, nicht ganz... jetzt "Fatal error: Call to a member function query_first() on a non-object in ........vbcms_global_modules/vbcmsmodul_news.php on line 47"


Quote:
Originally Posted by WeserInfo View Post
Mike ich denke wir werden da bald das Modul haben. Christian hatte uns auch bei dem Photopost Modul geholfen. Erstmal musste aber VBCMS Gold und die styles raus. Alles auf einmal geht schlecht. Wenn das hier fertig ist wird es im Modul Bereich wieder zum runterladen sein Wie auch das Photopost Modul.

Na klar.... ich sagte ja, dass die Glückseeligkeit davon nicht abhängt.

Und richtig.... was nützt mir ein Modul, wenn ich kein laufendes Forum einrichten kann, weil ich keinen Style habe!
Reply With Quote
Reply

Lesezeichen

Thread Tools
Display Modes

Posting Rules
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist On.
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Copyright © 2006, Reuter & Bloeß GbR.
| Datenschutz | Sitemap | Unsere Partner | Top |
Home Products Forum Über uns Support & FAQs
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.0 ©2009, Crawlability, Inc.
Tipp: Fussball | Heilerde
Shopsystem, Shop System, CMS, Webkatalog mit vBCMS CMS