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