|
|

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