|
|

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