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