Anyone know of a PHP script that does this?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • $5 submissions
    I help you SUCCEED
    • Nov 2003
    • 32195

    #1

    Anyone know of a PHP script that does this?

    You put it on your Forum signature (VB) and it randomly pulls titles from your blog. it is clickable.

    Thanks in advance
  • pornmasta
    Too lazy to set a custom title
    • Jun 2006
    • 20016

    #2
    the forum needs to allow links that generate dynamically code (i wouldn't).

    With a picture (.jpg for example) and an url rewrite you can call a picture and you can generate it dynamically, but nothing more.
    If the forum allows swf sig, it is possible
    Last edited by pornmasta; 05-23-2012, 04:53 PM.

    Comment

    • notjoe
      Confirmed User
      • May 2002
      • 5599

      #3
      Originally posted by $5 submissions
      You put it on your Forum signature (VB) and it randomly pulls titles from your blog. it is clickable.

      Thanks in advance
      Create a script that generates an image and sets a cookie on the surfer's computer. Have that image linked to another script that will read the cookie to figure out what post it is and send the surfer to the blog post. It's not exactly what you were looking for but it'll work.

      Comment

      • pornmasta
        Too lazy to set a custom title
        • Jun 2006
        • 20016

        #4
        Originally posted by notjoe
        Create a script that generates an image and sets a cookie on the surfer's computer. Have that image linked to another script that will read the cookie to figure out what post it is and send the surfer to the blog post. It's not exactly what you were looking for but it'll work.
        good idea.
        But one link per picture

        Comment

        • sarettah
          see you later, I'm gone
          • Oct 2002
          • 14297

          #5
          Originally posted by $5 submissions
          You put it on your Forum signature (VB) and it randomly pulls titles from your blog. it is clickable.

          Thanks in advance
          I have stuff that can do that. Not using it to pull titles from blogs per se, just from a list of phrases. But if it was had acces to the bog db then real easy to pull titles. If no access, harder, but still doable.



          .
          Last edited by sarettah; 05-23-2012, 04:58 PM.
          All cookies cleared!

          Comment

          • $5 submissions
            I help you SUCCEED
            • Nov 2003
            • 32195

            #6
            The mainstream wm forum dp has this feature but it does not RANDOMLY pull posts from your blog

            Comment

            • sarettah
              see you later, I'm gone
              • Oct 2002
              • 14297

              #7
              Originally posted by $5 submissions
              The mainstream wm forum dp has this feature but it does not RANDOMLY pull posts from your blog
              I just switched out my sig to point at my little rotator script. I haven't made it clickable because I need to go look at code I haven't used in a while before I do that, but I can make it clickable.

              I think Smokey might have some similar stuff. I know he was messing with the same technique about the same time I was playing with it a lot.

              .
              All cookies cleared!

              Comment

              • potter
                Confirmed User
                • Dec 2004
                • 6559

                #8
                Originally posted by $5 submissions
                The mainstream wm forum dp has this feature but it does not RANDOMLY pull posts from your blog
                Doesn't really matter where it pulls them from. You just need to write a small secondary script to create a similar file/database to the one it currently pulls from, and then have the script pull from that new file/database.

                Comment

                • sarettah
                  see you later, I'm gone
                  • Oct 2002
                  • 14297

                  #9
                  Mine is now pulling from one of my blogs. Took about 10 minutes to switch around, mostly turning off code ;p

                  I will make it clickable/trackable later on or tomorrow.


                  .
                  All cookies cleared!

                  Comment

                  • sarettah
                    see you later, I'm gone
                    • Oct 2002
                    • 14297

                    #10
                    Originally posted by notjoe
                    Create a script that generates an image and sets a cookie on the surfer's computer. Have that image linked to another script that will read the cookie to figure out what post it is and send the surfer to the blog post. It's not exactly what you were looking for but it'll work.
                    Problem there is unless it is your own forum and you are running the scripts there, then you are dealing with third party cookie shit. You can't set a cookie from an image generation type script unless it is on the same domain.

                    I looked at registering third party cookies a while back. Looked like a pain in the ass to me so I didn't go that route.

                    Easiest way is just to send them to whichever one was the last one you displayed. It is not a00% accurate but a hell of a lot easier ;p

                    btw, the sig is cliskable now.

                    .
                    Last edited by sarettah; 05-23-2012, 07:13 PM.
                    All cookies cleared!

                    Comment

                    • sarettah
                      see you later, I'm gone
                      • Oct 2002
                      • 14297

                      #11
                      Just reading back through this and I find I need to apologize for all my typos, I am actually literate to a certain extent. lol.

                      Typing fast on my laptop kb does not work well.



                      .
                      All cookies cleared!

                      Comment

                      • $5 submissions
                        I help you SUCCEED
                        • Nov 2003
                        • 32195

                        #12
                        Sarettah

                        I need text, not an image. Nice script by the way

                        Comment

                        • sarettah
                          see you later, I'm gone
                          • Oct 2002
                          • 14297

                          #13
                          Originally posted by $5 submissions
                          Sarettah

                          I need text, not an image. Nice script by the way
                          You can only do that if you have control of the forum code itself, or I guess if they would let you put an iframe in your sig.

                          No way that I have ever figured out to inject text into a page from outside.

                          As far as I have been able to figure, from outside the forum the best you can do is a clickable image.

                          Now, if it is your own forum it would be extremely simple to hard code a routine in if there isn't a plugin to handle it already,

                          .
                          All cookies cleared!

                          Comment

                          • d-null
                            . . .
                            • Apr 2007
                            • 13724

                            #14
                            I'm thinking that there is a way you could fudge this together using imagemagick

                            __________________

                            Looking for a custom TUBE SCRIPT that supports massive traffic, load balancing, billing support, and h264 encoding? Hit up Konrad!
                            Looking for designs for your websites or custom tubesite design? Hit up Zuzana Designs
                            Check out the #1 WordPress SEO Plugin: CyberSEO Suite

                            Comment

                            • sarettah
                              see you later, I'm gone
                              • Oct 2002
                              • 14297

                              #15
                              Originally posted by sarettah
                              Easiest way is just to send them to whichever one was the last one you displayed. It is not a00% accurate but a hell of a lot easier ;p

                              btw, the sig is cliskable now.

                              .

                              The sig is now keeping track by ip and refer string of what image was last seen and then grabbing the associated url for the redirect.

                              Won't be perfect because of dynamic ip schemes and proxies but it should be pretty close ;p

                              .
                              All cookies cleared!

                              Comment

                              • $5 submissions
                                I help you SUCCEED
                                • Nov 2003
                                • 32195

                                #16
                                Sarettah, does your script handle different FONTs and COLORs?

                                Comment

                                • pornmasta
                                  Too lazy to set a custom title
                                  • Jun 2006
                                  • 20016

                                  #17
                                  i learn stuff everyday

                                  Comment

                                  • Oracle Porn
                                    Affiliate
                                    • Oct 2002
                                    • 24433

                                    #18
                                    nice sig sarettah

                                    now give up the code please


                                    Comment

                                    • sarettah
                                      see you later, I'm gone
                                      • Oct 2002
                                      • 14297

                                      #19
                                      Originally posted by Oracle Porn
                                      nice sig sarettah

                                      now give up the code please
                                      Thanx.

                                      lol. Considering it.

                                      It is a project (have actual domains for it and everything) that I started on 5 years ago and then shelved with the full intent of getting back to it.

                                      It was not shelved for lack of interest but rather because of lack of income. I could finish it and maybe have something to sell and maybe make enough money or I could do outside contracting and definitely make enough money. I chose the sure thing.

                                      But ya know how that goes.

                                      So, right now (last night I spent an hour or so reviewing my code) I do NOT have a fully functioning user control panel for it yet. I have a 75% one but that doesn't really help much.

                                      I also have the blog pull just slammed in there, that would need to be dynamic so you could point it at various blogs etc.

                                      To the question can I do different fonts, colors? yep. You can control the foreground color, background color. I do not have it set up to use multiple foreground colors but that is possible I believe. The fonts are pulled from a font folder on my server. I loaded it up with a bunch of fonts that someone was passing around back then. A zip full of free/public domain (supposedly) fonts, mainly ttf. I say supposedly because there are tons of what are supposed to be free fonts out there that when you check them they are not actullay free. Since I support copyrights I would not distribute the fonts I have with the code. But since the program reads the fonts directory for the selection it offers up you just need to go find your own set of ttf fonts.

                                      Reading back on that, god I suck at typing and I don't even have my laptop keyboard to blame this time. So, sorry again for the typos but I ain't going back and fixing them this time.

                                      ;p

                                      .
                                      All cookies cleared!

                                      Comment

                                      • sarettah
                                        see you later, I'm gone
                                        • Oct 2002
                                        • 14297

                                        #20
                                        Ok, you need a folder for the make sigs script. This folder has htaccess that redirects any .jpg or .gif call to the make sigs program.

                                        So htaccess looks something like this:

                                        AuthUserFile /dev/null
                                        AuthGroupFile /dev/null

                                        RewriteEngine On

                                        ReWriteRule .*\.(jpg|gif)$ http://www.domain_installed_on/sigs/make_sig.php [R,L]

                                        Then I have a config file for the hook ups to the database and some other stuff:

                                        <?php

                                        function hookitup()
                                        {

                                        // full server path to ttf font library
                                        $font_path='/home/xxxxxxxx/ttffonts/';

                                        // font name to use for sig
                                        $font_name='Loungy.ttf';

                                        //font size to use for sig
                                        $font_size='18';

                                        // name of blog being pulled from
                                        $blog_name='yourblogname.com';

                                        // put mysql credentials necessary for your main database here

                                        $main_host='xxxxxxxx';
                                        $main_user='xxxxxxx';
                                        $main_pass='xxxxxx';
                                        $main_dbname='xxxxxxx';

                                        // put mysql credentials necessary for your blog database here

                                        $blog_host='xxxxxxxxx';
                                        $blog_user='xxxxxxxx';
                                        $blog_pass='xxxxxxxxxx';
                                        $blog_dbname='xxxxxxxxx';

                                        $maindb = mysql_pconnect($main_host,$main_user,$main_pass);
                                        if(!$maindb)
                                        {
                                        die("could not hook up to the main database");
                                        }
                                        if($main_host==$blog_host && $main_user==$blog_user && $main_pass==$blog_pass)
                                        {
                                        // if all data is in one db then use the same connection

                                        $blogdb=$maindb;
                                        }
                                        else
                                        {
                                        // if data is in different dbs then we need 2 connections
                                        $blogdb = mysql_pconnect($blog_host,$blog_user,$blog_pass);
                                        if(!$blogdb)
                                        {
                                        die("could not hook up to the blog database");
                                        }
                                        }

                                        $returnit=array(
                                        "maindb"=>$maindb,
                                        "blogdb"=>$blogdb,
                                        "main_dbname"=>$main_dbname,
                                        "blog_dbname"=>$blog_dbname,
                                        "font_path"=>$font_path,
                                        "font_name"=>$font_name,
                                        "font_size"=>$font_size,
                                        "blog_name"=>$blog_name
                                        );

                                        return $returnit;
                                        }
                                        ?>

                                        Then there is the make_sigs script (please not that I have some hardcodes in there for gfy, these were dynamic but I hardcoded the changes I made a few days ago for the blog pull in and demo and I have not gotten back to changing it up:

                                        <?php
                                        error_reporting(0);

                                        $ip2use=$_SERVER['REMOTE_ADDR'];
                                        if(!isset($_SERVER['HTTP_REFERER']))
                                        {
                                        $refer2use='';
                                        }
                                        else
                                        {
                                        $refer2use=mysql_real_escape_string($_SERVER['HTTP_REFERER']);
                                        }

                                        require_once('../sig_config.php');

                                        $dblist=hookitup();

                                        $maindb=$dblist['maindb'];
                                        $blogdb=$dblist['blogdb'];
                                        $maindbname=$dblist['main_dbname'];
                                        $blogdbname=$dblist['blog_dbname'];
                                        $fontpath=$dblist['font_path'];
                                        $fontname=$fontpath . $dblist['font_name'];
                                        $fontsize=$dblist['font_size'];
                                        $blogname=$dblist['blog_name'];

                                        // This assumes the blog is WP and the posts table is wp_posts
                                        $sql_str="select id, post_title from " . $blogdbname . ".wp_posts order by rand() limit 1 ";
                                        $result = mysql_query($sql_str,$blogdb);
                                        //echo "result=" . $result . "<br>";
                                        $blog=mysql_fetch_array($result);
                                        $id2use=$blog['id'];

                                        // mod to handle blogs. Not bringing in multi lines from blog database
                                        $numlines=1;

                                        $lines=array();

                                        $sql_str="select * from " . $maindbname . ".sig_track where ";
                                        $sql_str .="ip='" . $ip2use . "' ";
                                        $sql_str .="and refer='" . $refer2use . "' ";
                                        $result=mysql_query($sql_str,$maindb);
                                        //echo "sql=" . $sql_str . "<br>";
                                        //echo "result - pull from sig_track=" . $result . "<br>";
                                        if($result)
                                        {
                                        if(mysql_num_rows($result)>0)
                                        {
                                        $sql_str="update " . $maindbname . ".sig_track set currid='" . $id2use . "' where ";
                                        $sql_str .="ip='" . $ip2use . "' ";
                                        $sql_str .="and refer='" . $refer2use . "' ";
                                        $result=mysql_query($sql_str,$maindb);
                                        //echo "result - update sig_track=" . $result . "<br>";
                                        }
                                        else
                                        {
                                        $sql_str="insert into " . $maindbname . ".sig_track(ip, refer, currid) values(";
                                        $sql_str .="'" . $ip2use . "', ";
                                        $sql_str .="'" . $refer2use . "',";
                                        $sql_str .="'" . $id2use . "')";
                                        $result=mysql_query($sql_str,$maindb);
                                        //echo "result - insert into sig_track=" . $result . "<br>";
                                        }
                                        }

                                        $sql_str="update " . $maindbname . ".currentid set currid='" . $id2use . "'";
                                        $result = mysql_query($sql_str,$maindb);

                                        $line2use=$blogname . ' - ' . $blog['post_title'];
                                        $lines[1]=$line2use;

                                        $lines2use=1;

                                        $imwidth=0;
                                        $imheight=0;

                                        // should be reading this in from table for gfy make 900
                                        $width2use=900;

                                        // hardcode for gfy
                                        $maxwidth=900;
                                        //$maxwidth=0;

                                        $maxheight=0;
                                        $outstr='';

                                        $linechk=imagettfbbox($fontsize,0,$fontname, 'test');
                                        $height2use=($linechk[1] - $linechk[7]) + 5;

                                        for($linecnt=1;$linecnt<=$numlines;$linecnt++)
                                        {
                                        $workstr=$lines[$linecnt];
                                        if (strlen($lines[$linecnt])>0)
                                        {
                                        $linechk=imagettfbbox($fontsize,0,$fontname, $lines[$linecnt]);
                                        $currwidth=$linechk[2] - $linechk[0];
                                        $parts=0;
                                        $breakit=0;
                                        $breaklen=0;
                                        $holdstr='';
                                        if($currwidth>$width2use and strlen($workstr)>0)
                                        {
                                        $parts=intval($currwidth/$width2use);
                                        if (($currwidth/$width2use-$parts)>0)
                                        {
                                        $parts=$parts + 1;
                                        }
                                        }
                                        if($parts>0)
                                        {
                                        $holdstr='';
                                        $lines2use=$parts;
                                        $breakit=$parts;
                                        $chklen=strlen($workstr);
                                        while($breakit>0)
                                        {
                                        $linechk=imagettfbbox($fontsize,0,$fontname, $workstr);
                                        $breaklen=$linechk[2] - $linechk[0];
                                        if($breaklen>$width2use)
                                        {
                                        while($breaklen>$width2use)
                                        {
                                        $chklen=$chklen-1;
                                        $strtochk=substr($workstr,0,$chklen);
                                        $linechk=imagettfbbox($fontsize,0,$fontname, $strtochk);
                                        $breaklen=$linechk[2] - $linechk[0];
                                        }
                                        $currwidth=$breaklen;
                                        $newlen=intval($chklen);
                                        $testchar=substr($workstr,$newlen,1);
                                        if($testchar<>' ')
                                        {
                                        while($testchar<>' ')
                                        {
                                        $newlen=$newlen-1;
                                        $testchar=substr($workstr,$newlen,1);
                                        }
                                        }
                                        $holdstr=$holdstr . substr($workstr,0,$newlen);
                                        $workstr=trim(substr($workstr,$newlen));
                                        $holdstr=$holdstr . chr(13) . chr(10);
                                        $lines2use=$lines2use + 1;
                                        $breakit=$breakit-1;
                                        }
                                        else
                                        {
                                        $breakit=$breakit-1;
                                        }
                                        }

                                        $workstr=$holdstr . $workstr;
                                        $maxheight=$maxheight + ($lines2use * $height2use);
                                        }
                                        else
                                        {
                                        $lines2use=$lines2use+1;
                                        $maxheight=$maxheight + $height2use + 5;
                                        }

                                        if($currwidth>$maxwidth)
                                        {
                                        $maxwidth=$currwidth;
                                        }
                                        }
                                        else
                                        {
                                        $lines2use=$lines2use+1;
                                        $maxheight=$maxheight + $height2use + 5;
                                        }
                                        $outstr=$outstr . $workstr . chr(13) . chr(10);
                                        }

                                        //$maxwidth=$maxwidth+25;

                                        header ("Content-type: image/gif");
                                        $im = imagecreate ($maxwidth, $maxheight);

                                        // hardcoded colors for gfy
                                        $background = imagecolorallocate ($im, 51, 51, 51);
                                        $foreground = imagecolorallocate ($im, 255, 255, 255);
                                        imagettftext ($im, $fontsize, 0, 5, 20, $foreground, $fontname, $outstr);
                                        imagegif ($im);
                                        imagedestroy ($im);

                                        ?>


                                        Database tables I am using:

                                        --
                                        -- Table structure for table `currentid`
                                        --

                                        CREATE TABLE IF NOT EXISTS `currentid` (
                                        `currid` char(20) NOT NULL
                                        ) ENGINE=InnoDB DEFAULT CHARSET=latin1;


                                        --
                                        -- Table structure for table `sig_track`
                                        --

                                        CREATE TABLE IF NOT EXISTS `sig_track` (
                                        `id` int(11) NOT NULL AUTO_INCREMENT,
                                        `ip` char(15) NOT NULL,
                                        `refer` varchar(254) NOT NULL,
                                        `currid` char(10) NOT NULL,
                                        PRIMARY KEY (`id`),
                                        KEY `ip` (`ip`,`refer`)
                                        ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1102 ;



                                        I think that does it.

                                        Enjoy




                                        .
                                        Last edited by sarettah; 05-27-2012, 12:56 PM.
                                        All cookies cleared!

                                        Comment

                                        • PMProducoes
                                          Registered User
                                          • Dec 2006
                                          • 64

                                          #21
                                          sarettah


                                          not going to use it...
                                          but your action deserves some

                                          Comment

                                          • sarettah
                                            see you later, I'm gone
                                            • Oct 2002
                                            • 14297

                                            #22
                                            Originally posted by PMProducoes
                                            sarettah


                                            not going to use it...
                                            but your action deserves some
                                            Wow, 8 cents? I'm agoin to the casino tonight




                                            j/k, thanx

                                            .
                                            All cookies cleared!

                                            Comment

                                            • sarettah
                                              see you later, I'm gone
                                              • Oct 2002
                                              • 14297

                                              #23
                                              Fuck, I just realized that there is one more piece that I di not put up there.
                                              The clicksig piece is the piece that handles when the sig is clicked on and redirects it to the right url for the image they are on.

                                              The clicksig piece:

                                              <?php

                                              $id2use='';
                                              $url2use='';

                                              $ip2use=$_SERVER['REMOTE_ADDR'];
                                              if(!isset($_SERVER['HTTP_REFERER']))
                                              {
                                              $refer2use='';
                                              }
                                              else
                                              {
                                              $refer2use=mysql_real_escape_string($_SERVER['HTTP_REFERER']);
                                              }

                                              require_once('sig_config.php');

                                              $dblist=hookitup();
                                              $maindb=$dblist['maindb'];
                                              $maindbname=$dblist['main_dbname'];

                                              $sql_str="select * from " . $maindbname . ".sig_track where ";
                                              $sql_str .="ip='" . $ip2use . "' ";
                                              $sql_str .="and refer='" . $refer2use . "' ";
                                              $result=mysql_query($sql_str,$maindb);
                                              if($result)
                                              {
                                              if(mysql_num_rows($result)>0)
                                              {
                                              $work=mysql_fetch_array($result);
                                              $id2use=$work['currid'];
                                              }
                                              else
                                              {
                                              $sql_str="select currid from " . $maindbname . ".currentid";
                                              $result = mysql_query($sql_str,$db);
                                              if($result)
                                              {
                                              $idrow=mysql_fetch_array($result);
                                              $id2use=$idrow['currid'];
                                              }
                                              }
                                              }

                                              if(!empty($id2use))
                                              {
                                              $url2use="http://your_base_wp_singlepost_url_here/p=" . $id2use;
                                              }
                                              else
                                              {
                                              $url2use="http://your_default_url_here";
                                              }

                                              Header("Location: " . $url2use);

                                              ?>
                                              Last edited by sarettah; 05-27-2012, 02:07 PM.
                                              All cookies cleared!

                                              Comment

                                              • sarettah
                                                see you later, I'm gone
                                                • Oct 2002
                                                • 14297

                                                #24
                                                To put it together where you want to use it.

                                                href or url tag = your_domain_url.com/clicksig.php
                                                img src or img tag = your_domain_url.com/sigs/any_old_name_will_do.jpg
                                                Last edited by sarettah; 05-27-2012, 02:06 PM.
                                                All cookies cleared!

                                                Comment

                                                • georgeyw
                                                  58008 53773
                                                  • Jul 2005
                                                  • 9865

                                                  #25
                                                  You realise that op is going to use this to spam links and sell as a "service" to people?
                                                  TripleXPrint on Megan Fox
                                                  "I would STILL suck her pussy until her face caved in. And then blow her up and do it again!"

                                                  Comment

                                                  • woj
                                                    <&(©¿©)&>
                                                    • Jul 2002
                                                    • 47882

                                                    #26
                                                    you just need the script login to the board, and change the sig... not exactly rocket science...

                                                    If you are looking to invest a few bucks for this technology, hit me up, icq: 3337524
                                                    Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
                                                    Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
                                                    Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager

                                                    Comment

                                                    • raymor
                                                      Confirmed User
                                                      • Oct 2002
                                                      • 3745

                                                      #27
                                                      AuthUserFile /dev/null
                                                      AuthGroupFile /dev/null
                                                      RewriteEngine On
                                                      ReWriteRule .*\.(jpg|gif)$ http:// www.domain_installed_on/sigs/ make_sig.php [R,L]
                                                      FYI there's no need to set the null password and group files. Those two lines are better left off.
                                                      For historical display only. This information is not current:
                                                      support&#64;bettercgi.com ICQ 7208627
                                                      Strongbox - The next generation in site security
                                                      Throttlebox - The next generation in bandwidth control
                                                      Clonebox - Backup and disaster recovery on steroids

                                                      Comment

                                                      • $5 submissions
                                                        I help you SUCCEED
                                                        • Nov 2003
                                                        • 32195

                                                        #28
                                                        Thanks, Sarettah

                                                        Comment

                                                        Working...