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