|
|

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