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