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