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