|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
. t# }7 G- k% E// Theme Option: k9 R/ c L) I# P2 S
////////////////////////////////////////////////////////////////////////////////
$ q1 L: H9 Y" ?, H1 R, K& K9 e
7 m$ P7 i) S3 d: Q$themename = "Zenx";9 j- A& a# U9 x# m: ^2 R, k9 V% g8 y/ n" ^
$shortname = str_replace(' ', '_', strtolower($themename));: B# J* H& E; b+ Q1 X! i( A6 s3 b
% a& \! _ V: ~- y" h
function get_theme_option($option); f5 C6 }+ a6 L6 z& T6 c; C
{2 ~6 ^7 p. u+ A+ k- k' t/ p
global $shortname;! \% m7 y* p. L. `3 E5 `! u
return stripslashes(get_option($shortname . '_' . $option));# b! C/ }, g! P2 N, n( j3 [% |
}
% a9 W- V ]" ]9 u2 |$ ]1 }/ j& b, i) b& u) C) C6 i
function get_theme_settings($option)8 G& T. b- P0 f5 G1 C6 ]
{
% @9 N6 ~2 Q% r: J6 c return stripslashes(get_option($option));
( ^5 i3 T3 x/ l}0 ]/ k" j. t8 y6 N9 @+ a
$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");
6 p) d9 r" C0 ^: m$wp_getcat = array();
* y- O& A9 m9 R k+ y2 Y7 dforeach ($wp_dropdown_rd_admin as $category_list) {
% F% F8 X0 z" O$wp_getcat[$category_list->term_id] = $category_list->name;
6 T0 S: t* z, B7 M}
) j: Q# m8 O2 \# T% O0 O# y$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
3 @3 r8 R0 G# g8 G5 x! X$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
: k$ F# V( d( o9 d6 o$ C8 ~$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
" A+ w$ \8 ?1 \2 I+ `1 J5 T! O8 L' R2 T- ^& O$ |9 X* G) }
$options = array (
* g5 T( n: D& k" p; u% p. c( @0 F
" n0 P# P' r p6 }1 N w! A, y
8 [! W7 S. b3 \3 Y5 d array( "name" => "Blog Header Settings",
: \. D: V# ~2 ]2 R g "type" => "heading", P P. N& r6 y$ ] E- t
),. x0 a5 z' ?8 D, f& ^0 A0 i6 I* B
8 C: S3 t6 X& Q: ^& Y! |7 w+ N
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",$ T7 a4 W ]& L8 g# `
"id" => $shortname."_header_logo_activate",
! V3 T" Q z7 r- j# f/ q& I "type" => "select",, G; A0 n; ~' S/ d- a
"std" => "No",
0 N9 I, K0 \, a `! n( v4 ^+ c* A "options" => array("No", "Yes")),, K T7 i7 ~: }5 F4 \7 _; O( \7 D- S
/ N- |( r( e7 l, m( Q8 d array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
' |# r' [0 k; C! l "id" => $shortname."_logo_url",
6 y. N* Y+ n& O1 ] "type" => "text",9 f' b/ B5 t4 @ `# @: q
"box" => "social",
6 U% W7 ]0 t6 T$ r "std" => "",' G4 I( F8 _# s/ h& H8 ?
),
( H' B3 R/ H4 X! P6 T1 j% x 5 C& b. i6 d3 k! r. E
array( "name" => "Insert Header Banner HTML Code (Header)2 p2 {& T) v" L2 ?% H* ?/ {% [: S% q
<br /><em>*Recommended Size 468 x 60</em>8 |. a4 }6 X% x& D% ]
<br /><em>*leave blank if not use</em>",# z5 S v/ s& w* }, K
"id" => $shortname."_header_banner", V) u6 g; o/ i, \ ]
"type" => "textarea",: p9 |5 o) z! n% ^/ e! [- O
"std" => "",
7 f7 c5 O" q4 z% E ),& j9 |. J& u) D5 k# l- V6 S
& @1 y2 i0 i9 D array( "name" => "</div></div>",
& f1 y6 P& Z; w. ~8 M2 c "type" => "close",
( r' X4 _- w8 E1 j Y ),1 G8 f* f( N9 q8 N
3 O: N2 ]7 y, h2 k" m3 l
- e, E* r: n X$ |4 d
array( "name" => "Header Navigation Settings",
# Z2 F# t; J" \ "type" => "heading",9 m% p* ]: g0 X
),: @7 y+ E8 ^; @, d/ F
/ I8 m9 C3 j/ K+ \
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />7 Z, n0 a% _+ Y, v9 a
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
W- ?& B; c1 q# {3 h$ w <em>*Enter the page post ID number only</em><br />
* k/ L" V' }6 E& \ <em>*separate by comma</em><br />
0 u% a8 {/ `6 I7 o+ { <em>*Exclude pages which you don't want to show on the header navigation</em>",
, S+ N. m# ^' k" X+ [ p "id" => $shortname."_header_page_navigation",
4 J: @5 [8 K3 `! v Y) q' i "type" => "text",
# J! b5 s7 q8 j "std" => "",* s F, b" o! b, s0 j; X
),; A% f" w; w! J! L
. B' E* J! R' W* S. ` w7 ]5 z6 j1 K array( "name" => "</div></div>",# w8 b) W/ p2 D9 j, j$ d" D
"type" => "close",
" E3 h: Q7 ~& P$ @ ),7 N \: s. M4 a: C" u
; E: O) M0 O7 y8 Q# X' k3 h3 M
+ u# n9 V2 j+ l1 e; b0 X: H# E v. n5 h array( "name" => "Post Auto Thumbnails Settings",
* D# t8 D' Y. `9 q3 g+ ? "type" => "heading",
4 u# i- h* M% g; g: } ),* q8 e3 Q- E [: d; G9 g6 T% d
7 W( J& K( S3 _0 |4 d/ [9 ?" h
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
- C2 Z8 A5 W( n5 H0 @' w$ r' U "id" => $shortname."_timthumb_activate",
/ y0 v/ v S. \8 D "type" => "select", d o |7 z* |4 D
"std" => "No",, W& }; P4 I" k" J3 m1 r! N
"options" => array("No", "Yes")),
. {" |/ G. v9 K6 w
! V2 D1 S8 ~' |6 i: ^( `1 x# o7 w* _ array( "name" => "If Timthumb is enabled, Please choose its cropping method",
$ O( S' Q' B' w1 ~4 D "id" => $shortname."_timthumb_cropping",
8 F# s1 D% S8 q) f8 S* y/ h! A, g& U "type" => "select",- p1 d" y" o9 g" q1 ^7 g# Q% T- z8 s
"std" => "",
. ~$ e; z7 Y3 N7 Y6 T "options" => $crop_position),9 A9 b8 h8 x. b0 V/ j, l
4 T6 `; L- K' Y5 ` array( "name" => "Insert Width Of Thumbnail Image<br />3 f2 Q9 z* G3 s. L( l; k
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />+ L8 _- _' A1 f! I! e6 `% @& u8 X
<em>*Leave Blank To Use Default: 250</em><br />",
S9 J* c2 F* m) O5 \, S$ O0 Y "id" => $shortname."_thumb_width",
. ]; T. Z4 Q: g. Z3 y: ? "type" => "text",
- L# R+ y" ~: D0 e% @0 w3 c+ m "std" => "",
5 X4 c8 h/ \6 z1 ^ ),# I5 {( r& q0 \3 [
4 C8 ] R' c& y7 _* @6 P( k- v
array( "name" => "Insert Height Of Thumbnail Image<br />
6 t6 l% L- X" a: A$ d3 l <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
9 Q' Y- x" k3 u' X/ m- J <em>*Leave Blank To Use Default: 200</em><br />",* @+ }+ s: ^- m9 u
"id" => $shortname."_thumb_height",
$ a5 s) `& I( Y "type" => "text",2 L% \* ]1 F2 ^ e" Z+ A( M! {
"std" => "",
5 m, ]8 n. u" `* w- A$ O8 F; E ),
4 b" \2 @. F8 ~+ v, h7 L
8 B8 _- ^/ m" N! R2 j. a array( "name" => "</div></div>",
6 {' `, B) |# N; c5 m. n; _& A* n2 I "type" => "close",
$ e: B4 g. T! h$ I+ t! r. I ),, P( C4 `4 h* j3 @
+ d5 X1 s' @3 W9 I/ y& S
array( "name" => "Featured Content Slider Settings",6 N: e+ H3 e$ f |
"type" => "heading",
% q2 H( r/ K, Q D' |' o ), U3 _. {2 ?7 O3 Y8 Y8 D( D' a
- A2 M# ^& n* ?4 h array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",7 {# y; b; g2 D
"id" => $shortname."_featured_activate",
" E- {" X- [9 F# P "type" => "select",1 f- X Y" k- v$ \% J
"std" => "No",/ q U/ }8 \9 U' J( C
"options" => array("No", "Yes")),
" I+ V, r7 R4 y" W3 Z0 @- O# J: y$ p% x7 y) M$ \# x
5 Y/ g0 Q& V6 T" J; p( r3 E array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
# f4 A) g5 R3 G; h$ X "id" => $shortname."_featured_category",
. I1 U! w; F4 |, P6 t2 o "type" => "select",5 q6 ^! q, d# |! l( X3 J
"std" => "Choose a category:",
- U: G/ d# {8 Y# b0 t* w$ c "options" => $wp_getcat),. f6 n, t) W. Y; s8 [
- Q( k& u" r7 ~$ G( }) [
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",+ l2 m1 Q" x( m4 W/ T6 ]
"id" => $shortname."_featured_number",4 j* R" u3 M2 L1 s! S' X" p
"type" => "select",: A+ l0 r! ]6 p- k
"std" => "Number of post:",
3 o; P+ L4 k, z "options" => $number_entries),
- f! _, R. N& |5 T* `
( @$ E7 C2 a" S3 t# Z array( "name" => "</div></div>",
/ F- E3 ^& v6 L8 C3 v3 T "type" => "close",1 u1 T2 k- b+ w! P/ N
),
( B7 ?: z- s) S6 ? x% g
& j5 Z2 h1 S( m" \ P5 K array( "name" => "Featured Category Settings",
: B3 g( n( l. c C. v "type" => "heading",+ P8 e" L. q' p1 {! F9 \0 c& `
),% v1 I8 m2 I/ P" A' V2 H& U
! X3 r* m3 ~4 G array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",: d# `; D# |1 O# D( a$ c
"id" => $shortname."_featured_category_activate",
- B' g* W% x7 B# n, }" W "type" => "select",
5 \( s' R5 P% ]; S# A+ I "std" => "No",. C' p/ \$ a8 K/ |
"options" => array("No", "Yes")),
4 _( K6 Z [ z1 }- c$ O2 d6 `
5 k$ I* z) X7 c array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
( s, a* ?3 J! Q "id" => $shortname."_featured_category_id1",
9 P6 M- o4 d, ]; z- Y7 h- Q- s4 [* ` "type" => "select",
, y2 x' W: k( v6 q+ d0 }3 f "std" => "Choose a category:",
9 F5 \8 r ]2 I' m "options" => $wp_getcat),
7 S, J- D8 d0 ?6 r/ W1 [5 j. F
* V% t& m. x( ^: K/ r/ n array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
0 |+ ~5 h e3 t4 o6 o: w5 E/ w "id" => $shortname."_featured_number1", C) x5 Q0 R0 @, Y2 h4 y' j
"type" => "select",
' ~0 }) v0 m ?+ Y, Z- C "std" => "Number of post:",
* B; j) i! I7 V6 x "options" => $number_entries),, @) s K6 |& e& a3 c
( h2 i1 ~& }4 ?( H: |3 w
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
$ K& \% P; D/ G/ v4 K4 P) c "id" => $shortname."_featured_category_id2",
; C/ u! w- O n: o% v "type" => "select",
; z# L: N4 T. _, s/ h I" z "std" => "Choose a category:",' j: a6 p+ i4 r7 o' ?
"options" => $wp_getcat),
' @) N$ @, ]# w' @3 x. p
* a( @& w4 r1 Y g/ t# M$ s( c array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",% s/ u N) S2 l1 z) O, S2 w/ S1 D
"id" => $shortname."_featured_number2",
& }/ U/ t% Q' l" n# }* z "type" => "select",' N+ m% m5 a& d9 o5 ]" B
"std" => "Number of post:",
3 j2 @( r7 h( Y "options" => $number_entries)," G& K7 F* H. Y
% y" K5 p* V8 R: x- O2 h! }/ i; I
+ b: Y. Q, q4 T# P, b3 u2 b; U array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",( j& j: ^* E& f' q! \/ C
"id" => $shortname."_featured_category_id3",0 |3 e3 [/ [' w5 B
"type" => "select",
) h( _9 K" H) H/ m F "std" => "Choose a category:",$ X! Q& C5 ~0 G' Z7 v& I0 n
"options" => $wp_getcat),4 k: X, }9 y% k+ r. G
! w, K. x+ }7 C array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",- [; K9 i5 A! Z0 I9 m& i# {
"id" => $shortname."_featured_number3", T- M5 {: m3 \' y
"type" => "select",
; _( K/ w! U: x8 c& h7 z' {2 X1 d "std" => "Number of post:",
1 X! {4 D. t5 \$ N1 I "options" => $number_entries),
$ R/ G1 d, J" E- D: o" e7 m" W2 L
9 W* V5 } E0 ^# `2 W5 p# V! V! x- I; S
array( "name" => "</div></div>",
( o! Z' p2 y% } "type" => "close",
3 ?- i H5 M$ b ),5 S7 g! V2 t9 |( Q7 o. u
1 o4 r. L1 i1 ?# ], Z0 W
; Y, j" j5 u M# N D array( "name" => "Google Adsense & Analytics Settings"," U4 G5 y' j: @" U$ t& [
"type" => "heading",
' e$ r8 I4 R7 {8 m& u( F ),: ^- f* e5 q, l6 l e3 ?2 ?! c
& n( B) Z. N1 L& d& f
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
2 i. t8 ^+ g2 O4 n "id" => $shortname."_adsense_loop_activate",% f. I9 {7 R7 b. ^& F1 w+ e4 ~
"type" => "select",
5 [& \& g- G8 }: e- N/ c "std" => "Disable",
* b9 p8 \ {& J: a( a# D. R "options" => array("Disable", "Enable")),( H$ z0 ]. s9 j' D7 T! }
- @( |& `# g" N- u1 h array( "name" => "Insert Google Adsense Code For Loops Here<br />
. m7 {: e" W7 A, H <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",# S! N5 {) f0 F7 z; I1 q
"id" => $shortname."_adsense_loop",
7 i) d5 @. [! ]+ K! a& \* d "type" => "textarea",
$ s+ }$ F7 k( Y$ ^# c& I: } "std" => "",
# N: v% F& @6 |8 g0 o: N/ I* o2 a ),3 d+ G2 c. }2 Q4 p
* [7 S, K) X1 r$ K! v! \ array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",* }5 o5 E P1 i" m9 @) W+ n7 {) K
"id" => $shortname."_adsense_single_activate",. N) {" w a% g5 C; \$ g/ N
"type" => "select",
! e" Q9 P; N( h6 i% F "std" => "Disable",
9 m% d$ q: x; A& z6 |/ ? "options" => array("Disable", "Enable")),) Y: w" A! `% U6 Y
/ @" ?8 N0 E) F' Q; ^" a% Y0 \ array( "name" => "Insert Google Adsense Code For Single Page Here<br />% R0 {; _) T7 h J5 ]9 ]* E
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",5 R) C9 v$ r+ }- { p
"id" => $shortname."_adsense_single",
' a4 {1 t0 C1 `, d* ^0 w2 } "type" => "textarea",; d u: U1 [+ F
"std" => "",
1 ?' ^! n* q+ C f# U3 P ),
3 S. j4 R* B) |/ \
% H4 C1 Y" r& ?) g1 ]8 [
% o; L, f0 }! H' W; Q* i- N array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
1 K. n" ]8 r+ d "id" => $shortname."_google_analytics",* T& ^) d' k, k$ b3 \; A( H
"type" => "textarea",. O. x+ {6 \' R4 u, [
"std" => "",. e* N: _) s% l& \9 ~7 K/ P* o
),
5 p5 ? H9 l* r: g1 q# F, M6 Z. @6 b# v/ B( L, B X
array( "name" => "</div></div>",& X/ t( `: K. q* m
"type" => "close",* P: f4 Z" w5 g4 y g1 {0 }; A6 s
),$ A$ i+ L. Z" n: p: }1 V3 f
! |' A R. H- a6 w 8 ~& }: K# p9 S% o) u
array( "name" => "AddThis Social Bookmarking Settings",
: w& R* B+ V* Z, D "type" => "heading",
X9 f- Y% h5 p, j3 f- Y ),' Y" f+ c x {2 @
2 X# B! Y- i& X7 H! z
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>' y7 c3 h- j* _: o* n
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",5 G: b; ~6 d" k( }
"id" => $shortname."_addthis",
- Q( Q& R! {, w; j "type" => "text",1 D/ o8 ?6 b( U( g: m2 h
"box" => "social",
3 M% L1 f9 c3 P, ]; _. n( X+ B "std" => "",8 ]/ }0 u0 _+ I$ {5 u! L8 @( m, E9 @
),
) W& {% h& }6 V: K1 O( m, a+ S- G, s. Y# @' b% Q4 _' I
array( "name" => "</div></div>",, J( X; ?6 D" I4 B, [9 q
"type" => "close",8 f; _5 F: x& ^3 I8 b
),
( s$ y+ J' g7 E8 J9 D( b
) v/ i0 {# V' F* ^ * A9 P$ i# `6 Q7 i: i3 ?
; @! g Z4 v5 e7 G3 Y% o! P, @# C array( "name" => "YouTube Video Settings",7 o0 d$ n7 C5 y# F* H: e
"type" => "heading",
+ o+ ^, f5 V7 ~1 g5 @! @ ),
6 B$ P* m. L; ?
1 }6 c. b2 G& f7 B array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",3 _0 Y5 `+ Q* u! T# m( j* G* Q
"id" => $shortname."_emvideo_activate",
) h+ m! V( q k7 u7 s5 q "type" => "select", @2 V/ R: f4 M4 n+ v
"std" => "No",
% Y/ i" {) w- H1 L1 X "options" => array("No", "Yes")),1 W* m/ S8 q: n
: r& t5 P" R7 t* c/ b+ {. ?" s
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>",
& | S! ?3 p* Z) Z% m# m( K "id" => $shortname."_emvideo",' f8 m7 t1 Q5 ^ t4 l# @
"std" => "",
2 E* B* K! f, j "type" => "text"),
( w: s a& E& M( N4 P6 q
1 `. i. q8 f9 h( ~. N; s( } array( "name" => "</div></div>",
" B9 v" x% w3 Y9 Z F- E "type" => "close",
+ E8 Z' B! f7 s ),2 D. s3 e" g0 S8 S/ x% [( L
; \7 M. M6 u% B2 G1 \" i
array( "name" => "Twitter Settings",
5 s' I$ o# \5 O& w" _ "type" => "heading",0 O- ?# }! I8 J: n9 j4 j
),
# B) J) @2 R& `3 a/ E4 V+ X9 L
, ^+ `! o4 D8 m- I2 Z7 X array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
- Q3 d4 q! P8 `0 b6 G5 I5 H "id" => $shortname."_twitter_activate",' C( _+ t: b! l: Z- X
"type" => "select",
Z* e" `+ f" I5 H' V, `+ l9 t: K "std" => "No",& G3 {+ `3 c% ^' W& @
"options" => array("No", "Yes")),) Q' A1 r/ I, Y3 q& ?2 N# C' d4 g. `) |
) b# I4 B% v a2 z8 V9 t array( "name" => "Insert Your Twitter ID here( K: [. e/ @1 ]
<br /><em>*leave blank if not necessary</em>) }! y& y. r. w4 w1 ~' {) \
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
; e3 c& |6 I; T+ S6 ? "id" => $shortname."_twitter",
- W; a" ^( @; g* J9 s" {# s "type" => "text",' ]+ j# P8 H5 T' ~( }: ?
"box" => "social",& j" d* t* V# [" d0 s+ B- }5 ?$ [2 j
"std" => "",
( z5 a' D! _" E8 s% s8 U; f& f ),
/ k8 D3 o& `4 ~
! D# c, f P4 s' |/ C array( "name" => "Enter Twitter Feed Count here
* H; @6 x# G% `# M) u9 X: [% z <br /><em>*leave blank if not necessary</em>
7 Y! M5 ?5 F- y1 T( l; k$ u2 v <br /><em>*Enter How Many Twitter Feed To Display</em>",
1 A) b1 V# e* z7 @5 A1 A "id" => $shortname."_twitter_count",6 l5 d3 w9 y7 s) a
"type" => "text",$ @. X' D8 V: `' Q+ Z# s
"box" => "social",5 ]$ B9 w/ f G4 T* @/ H% p( V4 {
"std" => "",+ g( q% y% P7 U2 F) W% p7 z- a: Q
),0 J1 n& ~& L( k' v
1 L" v/ Z, E) Y0 F' E9 ]1 ^! X
array( "name" => "</div></div>",
! o1 w) [6 b% s. I' X V. L "type" => "close",
2 {" R9 d* ?; A ),0 p3 `9 t3 f/ i. O1 g% g
9 y& w9 C* _4 g4 d
& G, x$ Y; X: A, x6 A array( "name" => "125 x 125 Banners Advertisement Settings",! M7 w H1 s" ^# T' ]6 N) @, S
"type" => "heading",0 e( Q& W0 ]1 w, [' U6 d; e
),
9 }, [ A0 z2 Y- Q- j) k2 T4 w 5 |% N6 I! X8 w( X5 z! u
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
. l# G1 n' }7 I% G/ j "id" => $shortname."_sponsor_activate",3 l3 c1 Q# u# z- ?: M; G- j
"type" => "select",
: ^/ S: r% I% z' h- a2 | "std" => "No",
" N1 V" \0 E# s' K/ \ "options" => array("No", "Yes")),( B% @; A' G& Z' j4 [ B
& X. F% E+ i R1 z" B6 e
8 y( K0 a, }; \4 h' [ ] array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
+ g% ?% e2 [% C( W "id" => $shortname."_sponsor_banner_one",2 E( T8 d- i$ J4 c6 _3 Z$ Q
"type" => "textarea",6 z3 r, F \ ~ n/ D0 V
"std" => "",
. I8 K, W/ L) k3 } ), ) ]$ ^0 _) c/ `8 V
! K+ W( I- i/ @( P
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",% A6 ~9 @0 N+ W6 H6 J2 |' r( Q2 O
"id" => $shortname."_sponsor_banner_two",
1 L' g( u' p" i# d; L "type" => "textarea",% Y" O# c2 _1 t' T- L. u. X5 R
"std" => "",; u- v% B$ [& e) g8 M' F9 X ?7 E
),6 s8 e" N0 g) j# K
- D% N) ~7 ^* G- h4 `+ I
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",7 s* H4 Z3 x& x8 q/ n6 @* K! L
"id" => $shortname."_sponsor_banner_three",0 }& Y- t: q5 p+ l4 ~; L, o* t1 t
"type" => "textarea",( k, A8 [) I/ [+ f9 z6 b( j
"std" => "",& t- E O( d8 d1 z0 |! I3 I. J$ z
),
! a* z7 t; `7 `5 t- R& {) e8 w2 p4 @; l2 B$ f& L4 h
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",# P* @3 t0 b( A
"id" => $shortname."_sponsor_banner_four", r9 |1 C2 V( [1 \/ ]
"type" => "textarea",
7 @) P x# X" k- P8 _8 v "std" => "",
0 \1 M. w' g" [ ),0 x7 _& k" Q/ @& v* A$ @1 N/ D
! ?7 B% t2 ^' z6 `
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",% u- u' @ d7 `+ |5 H
"id" => $shortname."_sponsor_banner_five",
; x+ f9 H. Y3 r; Q! G "type" => "textarea",
( c8 }2 ~5 k1 T4 E "std" => "",
. b. A+ E( r9 y6 ?2 _ ),# S. m6 |- L) {, l$ ]$ Y& Z
0 ` u% ]9 K5 G1 c% f
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
& D* Q, |* d2 S: { "id" => $shortname."_sponsor_banner_six",0 ]' A6 ]8 l) O; R) }- g x
"type" => "textarea",
u7 ]* ?. @, b "std" => "",
8 O& U/ {0 D* V2 d" N: x9 n- @2 z- H ),
1 K; e5 H( j2 T# z; R4 M6 X) U m
' T4 y6 V4 M0 f array( "name" => "</div></div>",& N2 s! {$ |, ]2 U
"type" => "close",
4 y% ]6 I* O( C* m! p" ?6 [ ),- X& s \! M8 B0 f3 Q
. h0 `- X& F$ A+ j- `; e+ |- ^
" s8 E( u) z0 F# u" n. W- q6 K# R, b! ^$ e G
);
6 R6 Y( q" ?! A* E6 ^( n2 `! x5 d6 k* }$ S
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
: k7 w5 u6 _, A# o' ^; U( Y9 v5 m7 _1 g$ ?' E) t- n. p
echo "<div id=\"admin-options\"> ";
! y* Z# Q8 n: N% Y
; a. g! I8 y* G0 f; o5 P0 zglobal $themename, $shortname, $options;
- i# b" K: b1 ?) K1 tif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
4 p$ Y) c% Y# ?' P* hif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
6 t6 z, N( i4 P) D8 n?>7 W2 V- ~$ Z! {* S" k& y! e
: q) |1 A0 V; Y1 l9 C8 b
<h4><?php echo "$themename"; ?> Theme Options</h4>4 |' H! K, t- R/ L! x$ Y
/ ?# p$ X3 U* E9 e Z<div class="annouce">1 [& B0 I& V. t; A& h, b
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
0 V/ z+ J( \3 J# h2 F$ b<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>+ V( U+ w0 V/ X9 ]3 s7 K D M
</div>: g% X3 V( |5 K8 }5 ^% {
1 V( D# g& w f* [# G% l+ D7 K<form action="" method="post">3 M- {9 V2 w' `6 s, n
8 p$ u: ]5 ]+ E d( i T9 F5 g
<?php foreach ($options as $value) { ?>
) U% `3 F+ t7 ~9 X- H. `! G. v9 S% U
<?php switch ( $value['type'] ) { case 'heading': ?>
& x, j0 u4 u" q0 ?) [
. n. y# c+ B7 |<div class="get-option">
8 W$ M" ~* z" _1 p1 R4 S* o8 |" f( |2 w. r( g0 Z) j9 A
<h2><?php echo $value['name']; ?></h2>
" e5 g" \3 }. ]& y7 L) ^" ]6 g% n+ v6 Y- J+ `+ Q% y: q
<div class="option-save">; f0 b, b/ G9 I
3 t0 S# G' m) Y1 Z/ d& s9 ]+ a: U1 m9 X
<?php
$ S. H" @1 O5 N0 s! m' Y- t/ fbreak;
' }, x6 d) n% U7 X* ]% Rcase 'text':
5 L `; Y% W* O& n?>9 I3 R) @+ b8 B
; b2 t: g$ Y6 A1 Y( u9 ?2 S+ b
<div class="description"><?php echo $value['name']; ?></div>
) C; t6 r0 k9 {7 S4 b9 a; K: ^<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ($ \+ F8 ?: w3 g' C8 R! L+ ~ i
$ b" Z, e) T* `& A1 P, ?: c4 \
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
( \0 A* a; N" H/ N
1 a: I7 a' k |4 J<?php y' E; Z: S/ `( H. [ R
break;
: O4 S& x# T( w0 _" K8 F9 i! h% ocase 'select':
# Q# l. i: | e2 ]- a; d?>
9 j2 z5 G5 ^1 d$ n
9 W r7 s9 ?9 Y<div class="description"><?php echo $value['name']; ?></div>6 b2 f, r6 U. L3 ~& H3 w
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">* @1 N G* \9 I: [6 q1 E' ?
<?php foreach ($value['options'] as $option) { ?>+ Y5 x4 d* N& A6 r
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>! l/ |$ e" T6 f6 g
<?php } ?>
, Y0 A5 P+ z- X# i9 A- a</select>
: w! i6 \, u0 C( V) N+ w</p>
" ], }" I% `6 F2 J5 E. b2 [- u' C7 G4 m4 \$ h
<?php
4 @8 D1 T# a: b) Y. B( rbreak;+ K' D" H) v" k; X
case 'textarea':
! x4 K- z) s9 c, [+ F" v8 x" @$valuex = $value['id'];, h! s. `* ?7 o4 B2 a! b# s
$valuey = stripslashes($valuex);2 V" P' G) s. ^7 s, Q5 o0 I
$video_code = get_settings($valuey);
, r! p) M1 Q1 y0 W* l4 h4 @?>
% }4 O$ D5 G1 M3 r$ x9 c6 j' v( @' C" V4 Z6 ?! O3 r q
<div class="description"><?php echo $value['name']; ?></div>
4 S7 ~; j4 l( v$ l<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }: @) ]9 j/ }$ B) _
4 B/ Q. P( w) N+ S6 @% `3 ^: delse { echo $value['std']; } ?></textarea></p> t% N9 l- ]$ w8 a1 b
[' N- k% N1 V% z7 A) ^8 H! n9 b
<?php
7 H! C' k! `/ S3 f! abreak;
, p$ y* m/ r% a/ W k6 V+ |" ncase 'close':3 Q# ^9 U/ A/ U% i) i- }1 O
?>
8 P {; i1 Q s; g5 @9 k+ q1 k" [- e; w1 `+ Z2 q$ V8 l, h# t, o) m5 Y
<div class="clearfix"></div>
# S! W7 j* i; Y" i2 `! X# g! f( t</div><!-- OPTION SAVE END -->
! k4 h' }0 o' z& a4 M! _
! S: f, d( k5 B# }<div class="clearfix"></div>
! N H, V9 `* Q. R/ x U</div><!-- GET OPTION END -->7 M/ ] E7 p: Z
- p6 ]( C0 z5 i$ p' T2 A
<?php
$ i1 L9 Z7 ? f3 y$ @+ bbreak;3 w- Q( S1 e; x% Z
default;1 k; [( w: ~, }. i
?>8 y# d7 N }9 L/ l. o" e
$ |) n" X; k+ u
. I/ Y: }) X1 ~0 d0 a$ ~5 @/ W+ w4 p<?php
" j g4 I9 ^' Lbreak; } ?>
0 s4 j4 C$ J: {2 ~1 ?3 T" o6 s
$ d) s+ B1 T3 S$ y- [<?php } ?>5 E" I7 x; N7 `9 Q2 a
2 T6 \5 e8 k) r
<p class="save-p">
3 J2 e- I" u- V+ n; T<input name="save" type="submit" class="sbutton" value="Save Options" />
- V6 @! g1 I$ _. B! V7 Q<input type="hidden" name="action" value="save" /># T1 V- W$ [ T0 |9 q* d/ Y
</p>: g& z; b# \" a7 A5 e* g
</form>
: S7 e0 z, I& Y( c! ?% L
" l0 V" I& C: L5 W; F' A<form method="post">
" z) u9 ~8 f: Y<p class="save-p">
/ K& t3 E1 d0 {* ]' z<input name="reset" type="submit" class="sbutton" value="Reset Options" />* J7 a& Y, I6 i" z4 M/ K% Z
<input type="hidden" name="action" value="reset" />
* ^+ _. J7 D. H3 y5 ^</p>
5 ]( u% [6 n/ J% b4 q! i& f</form>: {! f4 \; R2 b+ i' l# ]# V* m
4 n$ a/ j5 o. O
</div><!-- ADMIN OPTIONS END -->
5 h/ x( E& `& B. x5 I3 R8 K }7 \2 G: ]3 d, d9 X
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
( \. Y0 g+ G5 G( \; Z
5 X0 E' K" p) F: ]$ Sfunction mytheme_admin_register() {: v0 ]4 ^! s0 K/ v! w
global $themename, $shortname, $options;
* Q$ I x& {. E0 K6 V/ \6 sif ( $_GET['page'] == basename(__FILE__) ) { `( Z% Z2 [" a% n1 [; @' ?
if ( 'save' == $_REQUEST['action'] ) {
& y5 [$ H9 l3 L C, Hforeach ($options as $value) {7 ^( j, d3 t, G+ D+ q
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
( g1 M& Q2 l }foreach ($options as $value) {
$ H' w$ H A; a5 zif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
& ]/ O/ G' x, W( ?0 h6 oheader("Location: themes.php?page=functions.php&saved=true");+ h V1 G6 l# Z7 ]4 P$ R, x
die;+ m+ m5 h# D/ q8 _; w
} else if( 'reset' == $_REQUEST['action'] ) {4 V3 S, \& ~# r# z/ A
foreach ($options as $value) {& ]6 x; d$ L% y) g, D w* Y% ]% d
delete_option( $value['id'] ); }, G1 S$ {* |% P" _
header("Location: themes.php?page=functions.php&reset=true");
) u, T% K& ?- s, Tdie;6 |3 t+ f4 T5 p, z
}
' x4 K3 f l! G3 ~# a* F4 V}
! M3 o- V+ |- V$ }0 C: S! Kadd_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
7 T- j* Q. a z+ o" Q% S( A* m}
( M5 _& r% t- h2 `0 H
C3 F7 o) m- Efunction mytheme_admin_head() { ?>" G/ y2 c. u2 W
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />: |9 Q* z q- {* @
<?php }! o, E# t9 L& N0 q% @
|
|