|
|

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