Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Removing Table Tags from Random image  (Read 8730 times)

0 Members and 1 Guest are viewing this topic.

Alaska

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Removing Table Tags from Random image
« on: June 26, 2007, 02:36:11 am »

Using CMPfetch v 2.0.0.  Looked at dao.php but thought it best to ask what is the best way to remove all of the table tags from the generated random image.  The image tags are OK. 

The plan is to wrap text around the image using CSS in a non table CSS site. 

Sample test page is:  http://paragondesignak.com/pictures/index.php

Thanks,

Jim
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Removing Table Tags from Random image
« Reply #1 on: June 26, 2007, 05:01:16 am »

Using CMPfetch v 2.0.0.  Looked at dao.php but thought it best to ask what is the best way to remove all of the table tags from the generated random image.  The image tags are OK. 

The plan is to wrap text around the image using CSS in a non table CSS site. 

Sample test page is:  http://paragondesignak.com/pictures/index.php

Thanks,

Jim


Your best bet, and way more recommended than screwing with the code, would be to set the Return type to resultset and just grab the image information out and form your own tag.

By changing the returntype you can get back an array where each row is a ton of information on the photo.



Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

Alaska

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Removing Table Tags from Random image
« Reply #2 on: June 26, 2007, 10:33:10 am »

Thanks for the hint, but my level of PHP is at the experimental level.  Was looking for the table tags to remove them from the code.  Maybe messy, but simple.  But they sure seem to be hidden.

Thanks again for the suggestion.......

Jim
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Removing Table Tags from Random image
« Reply #3 on: June 26, 2007, 03:22:27 pm »

Thanks for the hint, but my level of PHP is at the experimental level.  Was looking for the table tags to remove them from the code.  Maybe messy, but simple.  But they sure seem to be hidden.

Thanks again for the suggestion.......

Jim

The amount of PHP experience needed to follow my suggestion is LESS than what should be required to go in and start making code changes.  However, if you can get into the cpmfetch code and successfully remove the table code, you definitely can go back and do it the right way.

Remove the table tags is not going to be easy, and I so highly recommend against it - once you change the code you are into unsupported land.

Good luck though

Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

balafre

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 29
Re: Removing Table Tags from Random image
« Reply #4 on: October 29, 2007, 01:24:01 pm »

Hi,
in fact I'd like to be able to remove the tables too.
I'll try and let you know if I succeed.
Logged

balafre

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 29
Re: Removing Table Tags from Random image
« Reply #5 on: October 29, 2007, 03:09:38 pm »

Here is a quick and dirty way to do that (there must be a smarter way...),
NOTE : AS VUUD TOLD YOU ARE INTO UNSUPPORTED LAND
1. Make a backup of your cpmfetch.php first
2. Then find these functions in cpmfetch.php :
Code: [Select]
function htmlTagTABLE($extraAttributes="") {



$htmlOut = '<table ';

if (array_key_exists('tablestyle',$this->styleHash)) $htmlOut .= " {$this->styleHash['tablestyle']}";

if ($extraAttributes != "") $htmlOut .= " $extraAttributes";

$htmlOut .= " " . $this->getOptionAttributes("tableattributes");

$htmlOut .= '>' . "\n";

return $htmlOut;

}



/**

*

* @access private

*/

function htmlTagTABLE_END() { return "</table>\n"; }





/**

*

* @access private

*/

function htmlTagTR($extraAttributes="") {

$htmlOut = '<tr';

if (array_key_exists('rowstyle',$this->styleHash)) $htmlOut .= " {$this->styleHash['rowstyle']}";

if ($extraAttributes != "") $htmlOut .= " $extraAttributes";

$htmlOut .= $this->getOptionAttributes("rowattributes");

$htmlOut .= '>' . "\n";

return $htmlOut;

}



/**

*

* @access private

*/

function htmlTagTR_END() { return "</tr>\n"; }





/**

*

* @access private

*/

function htmlTagTH($contents,$extraAttributes="") {

$htmlOut = '<th';

if (array_key_exists('tableheadstyle',$this->styleHash)) $htmlOut .= " {$this->styleHash['tableheadstyle']}";

if ($extraAttributes != "") $htmlOut .= " $extraAttributes";

$htmlOut .= $this->getOptionAttributes("rowheaderattributes");

$htmlOut .= '>' . $contents . '</th>' . "\n";

return $htmlOut;

}



/**

*

* @access private

*/

function htmlTagTD($contents, $extraAttributes="") {

$htmlOut = '<td';

if (array_key_exists('cellstyle',$this->styleHash)) $htmlOut .= " {$this->styleHash['cellstyle']}";

if ($extraAttributes != "") $htmlOut .= " " . $extraAttributes;

$htmlOut .= $this->getOptionAttributes("cellattributes");

$htmlOut .= '>' . $contents . '</td>' . "\n";

return $htmlOut;

}


and replace them by :
Code: [Select]
function htmlTagTABLE($extraAttributes="") {



$htmlOut = '';

if (array_key_exists('tablestyle',$this->styleHash)) $htmlOut .= " {$this->styleHash['tablestyle']}";

if ($extraAttributes != "") $htmlOut .= " $extraAttributes";

$htmlOut .= " " . $this->getOptionAttributes("tableattributes");

$htmlOut .= '' . "";

return $htmlOut;

}



/**

*

* @access private

*/

function htmlTagTABLE_END() { return ""; }





/**

*

* @access private

*/

function htmlTagTR($extraAttributes="") {

$htmlOut = '';

if (array_key_exists('rowstyle',$this->styleHash)) $htmlOut .= " {$this->styleHash['rowstyle']}";

if ($extraAttributes != "") $htmlOut .= " $extraAttributes";

$htmlOut .= $this->getOptionAttributes("rowattributes");

$htmlOut .= '' . "";

return $htmlOut;

}



/**

*

* @access private

*/

function htmlTagTR_END() { return ""; }





/**

*

* @access private

*/

function htmlTagTH($contents,$extraAttributes="") {

$htmlOut = '';

if (array_key_exists('tableheadstyle',$this->styleHash)) $htmlOut .= " {$this->styleHash['tableheadstyle']}";

if ($extraAttributes != "") $htmlOut .= " $extraAttributes";

$htmlOut .= $this->getOptionAttributes("rowheaderattributes");

$htmlOut .= '' . $contents . '' . "";

return $htmlOut;

}



/**

*

* @access private

*/

function htmlTagTD($contents, $extraAttributes="") {

$htmlOut = '';

if (array_key_exists('cellstyle',$this->styleHash)) $htmlOut .= " {$this->styleHash['cellstyle']}";

if ($extraAttributes != "") $htmlOut .= " " . $extraAttributes;

$htmlOut .= $this->getOptionAttributes("cellattributes");

$htmlOut .= '' . $contents . '' . "";

return $htmlOut;

}
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.