|
|

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