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