|
|

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