|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////) ?/ @; F4 N" Z* P4 ?
// Theme Option% f6 O% a! l6 i8 I) `
////////////////////////////////////////////////////////////////////////////////# w4 i. E. Y5 j# v
! ^* h6 @7 l* Y) i
$themename = "Zenx";
0 s, E( q9 |% H% M& |, Y9 d" x# z$shortname = str_replace(' ', '_', strtolower($themename));- q( i, }0 k7 H7 U. Z% y
3 i+ |7 l' M+ w% P u' v0 O& \: f
function get_theme_option($option)
( q* f2 Y" X( T4 R5 X4 ?. }{9 M' a5 a- e' d x' C' @; b
global $shortname;) V4 h# G" O6 q+ ~& P& X
return stripslashes(get_option($shortname . '_' . $option));
4 L2 Q9 `- v5 A. M8 A$ g}0 _; b P4 W G; b3 t1 D
) C/ b! p9 C* r7 H" Ufunction get_theme_settings($option)
( N7 u8 p! e4 v7 y0 B{
& p( \# L* @" j* T5 v2 e$ ] return stripslashes(get_option($option));, W4 b' v9 [/ y: I: R0 |3 ]5 i/ t2 [
}( z# B0 S6 K8 Y/ q, S
$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");7 X! l a/ E1 X9 ]# ]& j
$wp_getcat = array();
* P8 u5 ]* v, u1 u6 _" `8 e0 sforeach ($wp_dropdown_rd_admin as $category_list) {, i0 g! M) |% Q2 Z4 s9 b: S& l
$wp_getcat[$category_list->term_id] = $category_list->name;
8 `; z* b; M' N! w+ S}8 O6 c+ U) S, L% K( i2 s
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");# C* j' s( p) q9 C Z' E& {+ U
$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");9 [, W I. K1 o
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
/ ~$ f4 _+ G1 s' u. ^- v
" o/ Z4 E7 Q( L J$options = array (
) C7 h8 E2 |* F+ W% }5 e7 d7 d! s& X; G# `
% o( e1 @9 O# r* x: P0 J, x! @
array( "name" => "Blog Header Settings",! ]6 @4 C6 U& j+ }8 O8 p9 _. l; i
"type" => "heading",
% Z: m( @6 f3 ^/ b6 D0 z7 r ),
) e: H+ ?3 _8 O2 W9 b' m |
$ N" B! R. W* K4 |, g8 |/ N array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
) N1 D" \ O. R3 H& b, c% W2 F "id" => $shortname."_header_logo_activate",, T. _2 a% R' C
"type" => "select",
8 f$ y5 g/ {/ Z4 K! [9 d1 }9 w0 K "std" => "No",
& d) H) S; m, y( W1 S "options" => array("No", "Yes")),* ?5 T6 y @: P0 U7 k! ?. v, e" N
+ L/ O0 v' X* k( O array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",' b3 l6 R p# j( J" j4 x& C: P
"id" => $shortname."_logo_url",
( P3 H: n7 g7 o "type" => "text",, o# A) Y# F7 t4 I
"box" => "social",2 L. C+ A3 N/ M$ L `
"std" => "",
9 q! {# o& D- f2 R* [' W. g2 S+ R ),. q( }& t# u3 X5 k: d; z6 u6 \6 D
* u8 B: u o% j! _
array( "name" => "Insert Header Banner HTML Code (Header)
. Z% ]- w z, v <br /><em>*Recommended Size 468 x 60</em>
0 d, L4 p; A2 A, @$ y* W+ Q <br /><em>*leave blank if not use</em>",( Z. S( N$ K2 \; l
"id" => $shortname."_header_banner",) Z* b3 @8 z9 {) ^
"type" => "textarea",9 I+ V# f2 R9 a
"std" => "",1 ?# ]5 m: }5 @( m! U. ?
),! \ t5 o3 h6 g& v( V
V, y- c O9 i; y' l. K) V array( "name" => "</div></div>",
! ]! r o% m/ J: s* Y "type" => "close",
" ^- e& _3 U! p5 [8 \; W( e, F ),+ ]" Q9 a% T2 |7 o4 J
0 l _. p- m7 U8 D+ H. k# n$ ?
& p' |8 `! @8 O# f9 X
array( "name" => "Header Navigation Settings",
3 K" G- O) T) |% K "type" => "heading",
# j3 o. B( t- a; F" W. ? ),
) Q$ i( Z- S9 e- {# F9 I( \7 j$ k' X
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
7 n4 ]( x N/ _) d1 \; J <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
% S) W/ H# c/ R9 ?6 V <em>*Enter the page post ID number only</em><br />. n* a" a& J& ^
<em>*separate by comma</em><br />+ I) |; ^; K6 m7 ?& b1 E' R6 O$ L
<em>*Exclude pages which you don't want to show on the header navigation</em>",
- j# P- V# H7 _6 {; O "id" => $shortname."_header_page_navigation",& ^' {( j5 y3 A: J2 D: H1 @
"type" => "text",
5 j; y I& ^# R1 U1 V7 d "std" => "",: R: Z1 i' I9 N- X
),
8 j7 y- C+ M. C3 D: R' X* k: V" Q: `9 k" U
array( "name" => "</div></div>",
* U% d* H& r* L "type" => "close",
' \7 N/ D" t8 r4 _8 n6 X ),+ n% U: M9 C( a* G1 Z: R
" f" f) r5 H9 F- Q; O- F/ S
+ M- g# u" K- q
array( "name" => "Post Auto Thumbnails Settings",) S' r* V5 `) h1 |3 ^9 e. Q5 [
"type" => "heading",
: T. F( c' f, p0 T/ F4 w- i ),: l& E7 Q0 `$ f0 S2 Q
. }/ L# J! ~, J9 b array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
3 w6 U* G4 c( m "id" => $shortname."_timthumb_activate",
8 d5 D- t8 Z$ i' `8 L7 X( Q "type" => "select",
: A5 x7 l9 H" t6 k "std" => "No",
) q& C$ h# a3 v% Y( o) L0 w "options" => array("No", "Yes")),
3 O0 F7 V2 @( q7 W
! u& W. Q1 E+ D% m/ X array( "name" => "If Timthumb is enabled, Please choose its cropping method",
9 Z3 w+ J& K. A2 t: Y( L4 Z "id" => $shortname."_timthumb_cropping",
" V; H" u' t7 Q9 z- M "type" => "select",
( u3 C, o3 I9 t& w* z" K "std" => "",
/ R5 V& ?, K L3 L "options" => $crop_position),
' O: Y# q' d3 N4 s/ j
7 ]- @# W" z/ I! i+ m0 v array( "name" => "Insert Width Of Thumbnail Image<br />
+ X8 y$ v% U: [$ O3 L5 o <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />, e# Q$ M5 x5 f" }$ ]# [3 A0 _% c- y6 S
<em>*Leave Blank To Use Default: 250</em><br />",2 u0 t) T. @" y5 `
"id" => $shortname."_thumb_width",# l) r) Q% {* f! {+ F2 O# m, q4 Y, o
"type" => "text",, w+ G$ T, ]3 O
"std" => "",
( S' `: }3 s' s+ J: r2 \ ),0 ?3 i$ d( Q. y0 L* i" T' z- l
3 H; X, t9 w# U* i4 j! |$ B array( "name" => "Insert Height Of Thumbnail Image<br />4 Y+ c: B" {2 f. ?6 D' y+ E0 x
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />5 A4 B7 H1 n; V" @% ?
<em>*Leave Blank To Use Default: 200</em><br />",) q+ k1 t+ P W9 ~8 ?$ k
"id" => $shortname."_thumb_height",5 S1 Z' J6 V3 r' Y( d
"type" => "text",
* O+ F8 Z1 @+ Q# T) M% H9 F "std" => "",
% j0 h: s F. K1 c* x7 K3 A ),
( r2 k/ r8 H/ f$ T1 Y; T
& }' X) L3 N8 e1 @, X array( "name" => "</div></div>",
% e8 p! @, D7 a3 ~3 ~ "type" => "close",( [' M3 K* Q2 A! h v
),' V* z# L u- m$ s9 G! U
" e0 D/ g w" c' N array( "name" => "Featured Content Slider Settings",
' {+ @( _) R w G3 _ "type" => "heading",
# n. n H8 U& P8 O- @ ),& P: w S+ h5 G
/ y" C' U; J, j" V' ] array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
$ F# x m0 k9 W) V% f) p "id" => $shortname."_featured_activate",
! a7 W* K0 h3 _& @4 ~ "type" => "select",
4 e1 Y2 i7 Y2 Z% U) Z: F/ n "std" => "No",; _$ f. Y* a3 v/ p' X6 C; T4 N; A
"options" => array("No", "Yes")),( F2 S j' u$ r
1 K) {7 B, r' H! M6 i( P5 g3 P# B
, [+ v# w, |$ h6 P; N* L/ G$ u
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
3 r/ f% {1 y1 c! O m* w "id" => $shortname."_featured_category",
n `. c5 G5 D0 v "type" => "select",$ s& l: i3 M' b' N) r
"std" => "Choose a category:",
1 @ O0 x7 D/ m9 c "options" => $wp_getcat),: F7 P# r, p @: P& @ a7 K' m/ o
. {- t! W U5 w6 S8 \' Q, n. M array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",% D+ x" {1 @, E: M q
"id" => $shortname."_featured_number",/ [( R1 z, O1 |. _6 k( P
"type" => "select",
" Z, g6 G% i5 j, [5 u "std" => "Number of post:",
, {! I B; _0 g7 _ "options" => $number_entries),
2 j/ A0 ^$ E3 e; R+ X
8 C9 Z# p0 P. x; [/ h$ N array( "name" => "</div></div>",! e9 H; X2 e& B/ m5 c
"type" => "close",
% O' g6 X0 |. F! h& p4 a# G ),5 \. l, U) D+ `, ]- @9 i0 M
9 x+ g" s, p9 u' r' ~3 E
array( "name" => "Featured Category Settings",
' _" Z5 Q! Q- C. h, L; {& I "type" => "heading",
6 o7 x( M- Q7 s% N ),' K4 |9 O8 _ M, d( c3 c" Q' I( o
" c& K" t9 i* u3 Q) e; T array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
& v/ b% i' u5 o/ H; ] "id" => $shortname."_featured_category_activate",
, t! z8 O6 O7 e% g "type" => "select",, @% p1 p) _: E% N
"std" => "No",. b( [( O9 Z7 n9 K
"options" => array("No", "Yes")),) Z7 K% B& f6 M- u: v/ ^2 _
4 }9 S! N# i$ ~) ] array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
3 h5 F' Z7 T& k$ ?. g& Z& X2 ] "id" => $shortname."_featured_category_id1",
' w, k! Z7 c2 G. M6 I5 } "type" => "select",
9 l. d. C. w, e7 \0 F9 z "std" => "Choose a category:",
, x6 U7 i4 F$ }7 N* o0 G "options" => $wp_getcat),& P2 F% |1 X r$ _2 W9 G# Y" _# o
4 e2 s. _( ^1 H4 w& _/ Q7 P; d
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
9 {0 J* G- l: M/ b8 `- ? "id" => $shortname."_featured_number1",
3 n3 w2 G/ u) D( j* @ "type" => "select",
" J/ A. o" _8 Y: r K; M% U "std" => "Number of post:",- }0 Z# ?* ?5 Q( u2 F
"options" => $number_entries),- K( M. _9 X, c7 b1 X. N
+ @5 n# i" \9 {+ |! G array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",! K6 ~9 x9 M# Y
"id" => $shortname."_featured_category_id2",
0 z( {- N! E5 w3 p5 z "type" => "select",
/ Q9 @- u! C, [ G6 c3 Y "std" => "Choose a category:",' V; y {9 y7 a: k0 A& W% D
"options" => $wp_getcat),/ \+ K% N% `9 y% N
& V) J' o7 S6 M, k# H, D: K* l
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
1 H* n2 w0 C. e "id" => $shortname."_featured_number2",$ U% q1 l, x f1 U- f" N
"type" => "select",0 G( v! @; ]7 b4 h
"std" => "Number of post:",
5 {$ F- K1 [" X U% s "options" => $number_entries),
1 P% O" p. ]7 ?' z3 h0 Z$ l : k- o1 c% t9 s" Z1 f3 u+ t
% `$ q) }8 p, _7 C1 N
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
P" b" E6 O- k" p "id" => $shortname."_featured_category_id3",
( s* U1 u- J- d; G "type" => "select",
. s- Y1 p. E' d! t! j5 w& e! j t "std" => "Choose a category:",, O( M, e- Z- k$ A" m. ?
"options" => $wp_getcat),- g" I" e; r" A9 g
, p6 A3 Y# J8 } K% ~
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",2 W1 \, o- C- W- n
"id" => $shortname."_featured_number3",6 s* D8 j! `5 s2 j
"type" => "select",
* C' Z; y* m- K8 M5 K/ x "std" => "Number of post:",3 b' I t5 M9 `
"options" => $number_entries),
: B0 h' ^! t" R1 J+ R7 D3 u$ w3 g
" ?2 ?- `6 V0 p1 x% A6 E
, R# q) Z3 |: a( U2 m$ y array( "name" => "</div></div>",
& Y( ^1 \+ j/ ? U/ J5 V "type" => "close",
- J+ H: {! O4 K; V# H$ x ),$ Z) h H$ a% K
; ?: I" Z3 F8 ~) I& ?( c
9 z8 w% C( D$ O/ A
array( "name" => "Google Adsense & Analytics Settings",& A8 [0 {* q/ }) k! x* T7 B
"type" => "heading",
$ {6 g( Q! {% Y7 _6 S1 M2 _* [ ),
9 Q7 `+ R( b; i; `3 J" z7 Q2 t- Z3 C1 u9 e
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
% j) n* z- Z8 d% G3 d" Q4 o "id" => $shortname."_adsense_loop_activate",
& [$ h$ ~( F9 R# O4 q" Z* P "type" => "select",3 \, w$ {' o( w) B4 I
"std" => "Disable",& F% B* M6 D& E( U( P+ d5 I) J5 ^
"options" => array("Disable", "Enable")),
; k( W7 k. H4 ]" r* q G% A u( ~1 |& x6 K$ _1 u7 F, L x# x: @( U. S
array( "name" => "Insert Google Adsense Code For Loops Here<br />9 ^$ C( i1 P4 b/ d( r5 K
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
! U& W9 W+ K6 g( k( F/ T9 q "id" => $shortname."_adsense_loop",
$ F, v" r$ ]- V+ p$ L "type" => "textarea",
5 L; T3 l. j: Y$ E5 k$ t+ H# X "std" => "",
6 W% b: ^- p6 ?* J" M( B ),
1 m$ v# _) O) p7 s3 h$ m( [6 {. G0 x: w: A
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
" Z+ _7 Z* G; s4 z "id" => $shortname."_adsense_single_activate",
* n$ l1 y- v) f "type" => "select",. \. q3 {" R9 @4 N, ^, B
"std" => "Disable",
+ j; U! c: x/ `. `% t "options" => array("Disable", "Enable")),6 F' R- d/ c3 G' r
7 _3 X% w/ ^$ ~; S/ ] array( "name" => "Insert Google Adsense Code For Single Page Here<br />
: J1 F5 w! P& K, j7 F% U* q! X <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",+ x! T" v6 _$ ?; f0 t. u
"id" => $shortname."_adsense_single",$ j% K4 `6 b5 r$ o
"type" => "textarea",
9 c2 M6 i$ Z& n) L8 d "std" => "",
$ V" ?, X/ a- C7 |5 ?' r1 R ),) p5 C- ~$ |9 V( g/ g1 E
% ?. l$ F9 ]" z
1 T" ~6 P9 |; g9 ^& \ array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",2 V0 |$ H' T0 c: u, @ V
"id" => $shortname."_google_analytics",$ u' V" f+ ^0 v5 O' l+ ]& M
"type" => "textarea",3 ?& ?5 a9 `" D5 z+ H
"std" => "",
/ N4 r7 c4 y0 s; }* w ),, y$ H' R. H4 L+ _/ j: o0 }6 M" `
; q; h- i, d+ \2 s$ O8 } array( "name" => "</div></div>",
8 I# w: e& }! U6 q. P7 I; x "type" => "close",' W0 }2 o% k# ~- s3 a5 t# y5 Q
),' d1 I/ x* B8 E# y' a' R
0 j, j# v4 w- Q4 K/ r) ~9 D
! L5 N$ W5 t' b I+ T0 c
array( "name" => "AddThis Social Bookmarking Settings",. i' U4 V2 e6 @; S
"type" => "heading",8 |6 ?3 [1 w0 T
),
' k! k" s: w" ]% R3 _4 j0 ?5 s2 S/ k! `$ T: y6 b
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>$ {9 G4 K+ T$ Y, {$ N+ m$ j" i
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",% i$ t- l& x9 Q
"id" => $shortname."_addthis",
; w4 i8 }8 @: @4 T' a# Z. [* J "type" => "text",
8 D' L) k# t/ v% h/ b" K0 g; Q "box" => "social",% v% V& U- {3 Y3 E0 C9 F
"std" => "",
u' \ M" a5 {7 X6 h ),( h' B4 W4 H5 N* l4 M/ N
z3 t& m2 n4 ^
array( "name" => "</div></div>",
/ M9 h1 \7 `7 b+ t p1 y1 | "type" => "close",
R$ h% @1 ~# w ),
! \6 c! H% m$ ?- x" `3 n; i; G $ B) i4 c$ t& Z( R# t [! z
; I. T9 H6 R; ]6 `4 _+ M4 `
* y' j$ U; i0 q( \% {. E array( "name" => "YouTube Video Settings",# B! A9 {- Y5 h5 c
"type" => "heading",
; k4 N' P1 L" u9 W0 M% R ),
$ o$ I3 H" ]4 F3 W0 l$ t: W5 \% m6 y. z9 g' P
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
" L: s/ e! e' C "id" => $shortname."_emvideo_activate",, G5 F) @/ R y0 ]
"type" => "select",
3 G+ e j1 ~ ~4 B9 { "std" => "No",. m# J8 @. M. ^, d4 h
"options" => array("No", "Yes")),
8 N& ?" D6 E5 B3 c. N* I3 d4 I- l/ l; R7 y, j8 F+ I# ^" E7 t
array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",0 Q. S# U+ K7 m" M& x6 {. ~( f
"id" => $shortname."_emvideo",
! b0 A7 H8 Y# e2 c. O+ g "std" => "",
8 B0 k0 \! s+ T, C "type" => "text"),5 X+ }0 R5 r& E
6 `! u, t- O$ _, O- G4 N5 \, A array( "name" => "</div></div>",
3 V% r8 D Z" }0 N "type" => "close",; Y G) A/ s* U1 o( m
),- v4 U* b. n P0 P% ^2 |
9 v- ~$ {" d4 N% L- N j array( "name" => "Twitter Settings",3 F4 g# i, q3 {6 d1 ^" d
"type" => "heading",
' \" F& E! s9 K/ L+ a* J0 v0 A2 o9 Z# h* q ),: M) m! V1 C9 h. a3 T) P& z
3 \: f; Q2 e- n8 C6 f0 J& f4 ]
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
2 Y" x+ P+ _ Q7 u "id" => $shortname."_twitter_activate", ?) w7 H/ p. b5 P' z
"type" => "select",
7 U. {1 O3 n7 T4 `' r "std" => "No",' P) L, O; }# y
"options" => array("No", "Yes")),6 |+ R( z8 ?) H; s/ o
% u2 u0 D7 }1 A( D% {3 |& `, K array( "name" => "Insert Your Twitter ID here y+ A8 q- P5 m
<br /><em>*leave blank if not necessary</em># H' A( V$ r) F) ^" K/ s
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
; E- u, s& N. Z2 q+ @5 g, [3 I* B "id" => $shortname."_twitter",
3 h* d3 C9 Q0 K' \! l "type" => "text",
. ^4 T6 @- N& n! E: p "box" => "social",
" m: ~* N6 l) A+ _ Y6 l "std" => "",
2 j9 k; ^9 ?% L ),7 t5 S$ @7 C4 m R
- o# n: s: y* l6 T' e
array( "name" => "Enter Twitter Feed Count here
! _( K! R& }1 ~6 M5 Y# D2 p0 R <br /><em>*leave blank if not necessary</em>
# Z G9 l% J" I! ?( d6 N <br /><em>*Enter How Many Twitter Feed To Display</em>",
2 q. J& _0 f3 `/ c5 Z+ L "id" => $shortname."_twitter_count",% _8 F9 Q9 W& v9 @ e; A
"type" => "text",
9 B& l! t4 I$ c0 Y "box" => "social",
) Y t3 U' q6 N3 h8 W: z "std" => "",8 G% I3 @! W4 g* ^
),
5 N! B2 @) F% f& _ Z0 b; @1 t$ n2 b7 D! T
array( "name" => "</div></div>",
$ J: [" F" t7 F, ]8 ~ "type" => "close",
" H6 h* E) K# s! d8 ^& R6 T# F ),
4 ]& A9 q W3 H: W7 p . M' B5 h3 \9 c) D- a* n$ s
% Y& F' ]! G" Z8 S
array( "name" => "125 x 125 Banners Advertisement Settings",
: P0 J# e: z" J* o "type" => "heading",- q" ]0 _' s2 o# l
),
' L+ d, C3 K: t8 Y, m+ ?4 L7 b2 o
2 m- E2 R: |3 M( c5 h; z array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
; p8 ]# D+ i* v "id" => $shortname."_sponsor_activate",
% [, c9 e& y1 l1 I% P; z8 N8 W3 N "type" => "select",
) }6 [" P4 G- q7 q/ o "std" => "No",! J% X, M7 M; T3 O
"options" => array("No", "Yes")),* Q1 v u7 b+ V
! Z# g" |7 a. u6 B9 S( V; p7 a1 k" _9 h
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
, D' K- s% m, v% q* X4 O "id" => $shortname."_sponsor_banner_one",- V! I5 X& E d" n$ T7 N
"type" => "textarea",
( X2 U, G* \1 w4 |0 ^ "std" => "",
) X+ b1 P1 i# A8 A, x5 A ), 2 S9 |6 d" u X
0 _9 g+ C# \: J array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",5 {2 x' I# p; O# s3 r, y0 e
"id" => $shortname."_sponsor_banner_two",
6 r1 y% c2 f( [6 o- ~+ ` "type" => "textarea",
9 T- i9 x% Z% w$ i# z, G& Q "std" => "",
" \5 z- y4 _3 Y1 {" ] ),
/ _" `- g# r5 s @, m% W5 ^
4 X: S( L5 G% @( n/ G array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
0 P8 k. Q+ ]- C i$ T( T3 X) w "id" => $shortname."_sponsor_banner_three",# l- R( x3 C" T8 k3 X* Y
"type" => "textarea", c n( R2 N! i' ^! k8 r* z
"std" => "",
2 x# `6 k. J+ L8 B ),: _; i$ C5 i$ Q1 m
3 [9 \. F! l$ Y2 z1 z% b
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
9 D2 r1 a! ?' I3 q: {% a. w "id" => $shortname."_sponsor_banner_four",- f* U$ M _) P1 Z3 N) p
"type" => "textarea",' `4 A" U% I! S J
"std" => "",
+ ?& p* {/ \5 x1 x: I2 h ),
' {: ^9 e8 h& Z/ C3 ]! [5 a [3 ~0 A) _0 b# S
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>"," J+ n) Y8 S2 `* q f: Z% m3 D
"id" => $shortname."_sponsor_banner_five",% e$ _4 {6 [4 q5 @1 [3 s# d
"type" => "textarea",7 }& e& ]1 r) G7 @7 m: g
"std" => "",( J7 g* E Q( S3 q/ s o) h4 C
),
/ `% U3 s1 S2 w# \: X1 O. b7 t- F2 C0 A" c4 @: r$ | W
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",. [! `5 ?. f& i5 w4 p& u
"id" => $shortname."_sponsor_banner_six",
2 j1 J& p2 R& ^) o) D* m4 _ "type" => "textarea",! ~$ K3 H5 s) l! ^9 z% f
"std" => "",* _" c3 F( g4 c+ r. i4 V9 {/ ?
),
7 K- ~8 y( B( o0 a) y+ [" ?. X5 o9 I5 p9 v
array( "name" => "</div></div>",
: g8 G* {- G) d! P: y& ^3 r4 R1 H "type" => "close",
2 Q7 u/ |. Y$ P0 } ),5 }: A2 y: W4 r! _2 U$ P0 \
( Q k! k# T3 k6 D- N
) ~4 z {$ y2 r$ A$ B7 Q; C+ Q& z3 g. o% i
);/ b! _7 L& X% j5 v5 Q5 M3 o( y
- O! b; {6 w& }4 b& g9 y% u
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {0 c0 W& \9 o8 R7 w$ _* G
( h5 j* ?) R. h! J. Z' y: {
echo "<div id=\"admin-options\"> "; m4 M0 r8 X7 |8 s
/ ^( M3 o0 u; v3 Z7 \% f. x0 y( L: t
global $themename, $shortname, $options;6 a+ \6 a9 L9 x, k1 u/ U
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';( k; n4 M9 {, x3 I0 r8 I+ Z
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
. a& |; @# }! G! B, Y9 Z6 v. k5 v?>
& o1 q7 A2 V8 t) k, z# K+ s9 ^1 _+ e Y. ]
<h4><?php echo "$themename"; ?> Theme Options</h4>
; W' N5 J |% ]. e/ j7 j
% |5 ]2 l! \) N<div class="annouce">
2 ]2 U1 Q5 x' f* S4 L<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
- |! ~: p& I2 z$ ~<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p># x* Q' [% @8 L7 t7 p. R
</div>
/ ^& x: C- k* i) j( \2 k: x& x) _: X0 h3 N1 ?+ J
<form action="" method="post">
2 a f/ m* {& ^6 ~' T' n; x# N. i! h3 `, K+ L% ~9 `/ |
<?php foreach ($options as $value) { ?>( {" H; n7 r- W5 n7 J8 }
9 b" A4 R& V2 e `) ~<?php switch ( $value['type'] ) { case 'heading': ?>
$ E- {: T& P& E8 U+ h3 c/ U
- v* ~ s4 s1 @" ]8 p+ r$ p9 e<div class="get-option"># [5 g/ k$ h6 t7 O2 L* @
9 ]7 E+ f8 y. o! s' K: D
<h2><?php echo $value['name']; ?></h2>+ S3 A4 Y; z( x
) ~4 a8 O" S% \2 }9 p<div class="option-save">
# u! l5 Z5 ^5 I) R6 \! T+ z7 c, Z
$ ]9 x7 M$ e: N" S* u<?php; L$ i# [" j* f7 R2 ^$ B2 o
break;
. e+ b6 r1 }2 Y, \: r& rcase 'text':3 u9 S8 b }# G8 X+ C& O
?>
4 y& p2 D: U' g5 \: p; }7 b0 L: b V# R/ @
<div class="description"><?php echo $value['name']; ?></div>+ m, @: W% U" C( J3 M5 ~6 T/ l
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (( m7 }! T% t# y: g, t9 d% E
4 @6 p' I* E4 s) M" f& j' }get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>) s5 U ^' z+ R& \9 s; L
9 K2 V5 O w5 U4 H" ~& z
<?php* ^9 L: i+ ~: B) c
break;# B. [; e7 h+ j0 j- m. F
case 'select':4 b. x: y+ W. z' j9 Y- ]
?>+ Y8 e! u, N& O. A2 Z) p
5 d: L' y F9 x2 }
<div class="description"><?php echo $value['name']; ?></div>
7 o& C. z, n" ~; \& U<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
3 e6 U+ m- z7 Q4 `% X9 b3 t<?php foreach ($value['options'] as $option) { ?>/ Z0 A% y% N- g- R
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
! l5 J% x, g+ ]' s; a$ i( v) r<?php } ?>% A. S# T! d& o
</select>
" m1 j6 i/ p- ` @/ x9 P: M9 q/ m</p>
+ O, o/ `! Z* y' [9 {+ ^
4 X" f6 x3 Z# p t<?php
% j- [% D$ V9 G* K+ M) c4 hbreak;, c2 c3 Z; o$ D6 q" q
case 'textarea':1 ^: l/ M+ b1 Y7 ]" g% ?5 |) c. ]: a
$valuex = $value['id'];
% l, g4 _8 y5 L$valuey = stripslashes($valuex);
/ S5 z4 w V0 B# A7 S$video_code = get_settings($valuey);) D2 p1 r5 D* l D5 q7 w; j
?>( J( x+ v! H/ I! [5 O" Y
Q0 x9 \: c6 F( p0 h" J<div class="description"><?php echo $value['name']; ?></div>7 ^& v! S6 [0 i2 r! _% {- |& \
<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
1 C3 ^# H& Y( x( q G4 y1 d' Z
) [0 ?- f9 P% r4 R) n9 L2 T8 aelse { echo $value['std']; } ?></textarea></p>9 g# ^* r! f8 I. Y
0 E/ V$ J( h, @& d r7 ^<?php
' J! g2 I. p0 Jbreak;7 Q2 L; ? ~6 a# L& @+ D, J" X" S
case 'close':
; P; c6 u9 h' V+ E1 K/ B?>
$ a) ^$ Y% ?& C- y6 Q$ G% \
! |4 S8 n* w; \1 K8 ~7 k<div class="clearfix"></div>
+ S6 @' m9 b4 R4 n* ?( p</div><!-- OPTION SAVE END -->' d8 m4 r' o, X4 S2 m( c
$ I0 e0 K+ ~) e/ J V3 z8 {# b$ g
<div class="clearfix"></div>1 P) L! B {0 O8 @9 y) ]
</div><!-- GET OPTION END -->
* M6 }* o- k( W1 ~$ i
0 M* k. b6 Z$ h2 M<?php$ |1 P6 v, t* K) K7 Q/ S
break;
) e8 J; j# |- ]. A7 ]3 x# ddefault;
: n3 S2 E2 a& q# d9 R1 O' _?>
5 b4 M P6 {! K$ r5 T! r
/ e2 n& W0 z2 ~5 w0 `: ~1 C9 u' X: l$ N' [- L
<?php
7 B1 n- ~: V1 _; Rbreak; } ?>
! _2 X4 M+ A4 ?# T; Q2 n5 L# o! ]& O$ [2 u3 }2 N% f! l
<?php } ?>7 V1 e1 Q9 s$ r/ M
1 L+ X. l0 F s, J- x0 I
<p class="save-p">
9 c( {. f5 [2 y, a, W<input name="save" type="submit" class="sbutton" value="Save Options" />" P+ h1 h( O! m& Z1 s! c
<input type="hidden" name="action" value="save" />& V: ?$ V4 |8 w' O: U" ^
</p> c5 }: k2 m- i% f3 p: P5 L
</form>
; o, e4 j, A9 w
/ u" N6 ~" |$ g5 T$ X$ L<form method="post">/ [" s* v9 D; Z2 L$ k$ u
<p class="save-p">
! U+ a+ _) Q6 b% U& Q<input name="reset" type="submit" class="sbutton" value="Reset Options" />
( _/ y. a2 T. T/ y3 q4 @( G6 E8 x<input type="hidden" name="action" value="reset" />& o4 r) t6 u& b J- F5 O
</p>; l6 b! N0 G3 k& J: Y E! g: Y# Q* \& P
</form>. Q. s$ {/ S" ?- M6 S5 G* k+ E. D
' `# @' E" i' {* Y5 H3 @</div><!-- ADMIN OPTIONS END -->. O# N! A! Q3 }: _
# U) |2 }0 Q) U) S, M<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
* q& l7 V/ ^) p
/ Q( ?* v- A7 h% _* N( t9 Yfunction mytheme_admin_register() {. _: H4 w# A4 n% t2 x* n; U: K! a; \! X
global $themename, $shortname, $options;% w& M: M# \! K ?" o) a& a- L8 i. t
if ( $_GET['page'] == basename(__FILE__) ) {
. L- k; S0 X0 B2 W# i8 _) C/ jif ( 'save' == $_REQUEST['action'] ) {
0 W3 U5 X$ S+ S2 F+ O% j- dforeach ($options as $value) {4 f; S5 ?. e& H: \- h4 B k
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }+ U: S2 H+ {0 x- T$ z
foreach ($options as $value) {, N% U. c# S6 r7 K6 j& S1 u
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
4 p( s2 X4 b; S6 ~; }0 i. g7 Mheader("Location: themes.php?page=functions.php&saved=true");' [) a+ ?% N. E d8 j1 G
die;
; y* Y' Z8 T' U0 {6 G) @# N2 g8 R S} else if( 'reset' == $_REQUEST['action'] ) {
! g: C- ~% H8 j$ |& L. L- m& [( pforeach ($options as $value) {* F8 ?. w8 r& H. O' |
delete_option( $value['id'] ); }
) W0 m5 \* b0 v+ T7 {, b4 Z vheader("Location: themes.php?page=functions.php&reset=true");
$ Q1 T$ m8 d* \die;
. e4 A+ g: y' W' N}; q: n5 \# s+ d* l1 {) _ ~
}4 h. v7 u8 `, T; g4 K
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');! e" V" K. o7 Q0 s
}
% b8 ^/ b3 E# O; d1 C5 P9 {# d. O6 D; A
function mytheme_admin_head() { ?>
% k1 G: R8 H* d O. j! z<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
% S- a& K1 w C& Q" K5 g<?php }
8 \( n% U: }/ s |
|